How To Add Google Tag Manager In WordPress Elementor?



Do you want to track user activities on your website?

Install Google Tag Manager to monitor every action on your business website performed by the various visitors coming to your website. For your business website, you can try using the Modern Business WordPress Theme.

Google Tag Manager is an outstanding, free, and very practical tool. It’s part of a Tag Management system (TMS). It consists of code segments collectively known as tags on your website or mobile app. Once these tags are inserted into your site, you can easily deploy analytics and measurement tag configurations from a web-based user interface. It is a completely secure tool.

The necessity of adding Google Tag Manager in WordPress.

Adding a Google Tag Manager in WordPress is required in order to measure conversions, form submissions, and link clicks, and collect other analytical data on the website. Some websites need to add code snippets. All these snippets are added and managed with Google Tag Manager from a single dashboard.

Google Analytics, Google Ads, Google Optimise, DoubleClick, and Google AdSense include built-in tag templates. A number of other third party analytics and tracking services are compatible with the Tag Manager. By doing this, you can manage your code without spending time adding and deleting tags. Not to mention that a single script loads all of these different pieces.

Variables in GTM use to simplify and automate your tag configurations. Containers are also a bundle of tags, triggers, and variables installed on a website.

Overall, Google Tag Manager in WordPress is a mechanism that is utilized to track the different users interacting with your website. It helps you improve the weak areas of your business website and enhance its performance.

As we have obtained the fundamental information regarding Google Tag Manager in WordPress. Now we will be explaining the methods for adding the Google Tag Manager in WordPress.

Let’s start to understand the methods for adding Google Tag Manager to the WordPress website.

How to add Google Tag Manager in WordPress?

Inserting a Google Tag Manager in WordPress does not require adding or editing any codes or any kind of setup tags.

So start to understand inserting Google Tag Manager in WordPress.

To sign up, you must first go to the Google Tag Manager website and select the 'Start for free' button.

You will reach the Add new account page after logging in. Click the "Create Account" button now.

You may then choose a country from the dropdown menu and input a name for your account. Additionally, Tag Manager will give you the choice to provide Google with anonymized data. Scroll down and click the checkbox to start.

A container must be added to your account. It might be a server, a website, or an app for iOS or Android. We shall select the 'Web' option in this instance. The container name might be the domain of your website. When finished, use the 'Create' button to go on.

The terms of service for Google Tag Manager will now slide in from the right side of the screen. To accept the conditions of data processing, tick the box at the bottom and then press the "Yes" button at the top.

Your account will now be created in Google Tag Manager. It will then display tracking codes for you to put on your website.

Simply copy these two scripts, as you will need to put them in your WordPress website's header and body sections.

How do I add Google Tag Manager code to WordPress?

Google Tag Manager in WordPress can be added to the site in three different ways.

  1. By editing the code snippets
  2. By using a GTM plugin

1. Add Google Tag Manager to the WordPress website with code snippets.

The WPCode Plugin is used to add the code snippets. If you want to insert a custom code onto the site, then WPCode is the best plugin ever.

On the other hand, the premium version of the plugin comprises additional features like a code snippet library, conditional logic, auto-inset snippets, and others.

To use the WPCode plugin, installing and activating the free WPCode plugin is the first step.

You must go to the Code Snippets » Headers & Footers page from the WordPress admin panel after activation. Enter the codes you previously copied now.

Paste the <head> code in the header field and the <body> code in the body field.

Don't forget to click the 'Save Changes' button when you are finished. You may now start to utilize Google Tag Manager on your WordPress website.

2. Add Google Tag Manager to the WordPress website with the GTM plugin.

Plugins in WordPress are the most convenient and uncomplicated way to extend the website’s functionality. Google Tag Manager is one of the plugins that is highly recommended for website analysis. The easy installation steps for the GTM plugin are:

Log in to the WordPress admin panel.

Navigate Plugins->Add new

Explore the Google Tag Manager.

Hit the ‘Install Now’ button.

Move to Settings->Google Tag Manager and type the container ID of your GTM.

Because it is essential to activate all GTM capabilities, the <head> script is appropriately inserted into your page. For users who have JavaScript disabled, the iframe script snippet in the "body" section serves as a fallback. WordPress lacks a hook that would allow for the placement of custom code within the body tag, thus by default, it is put in the footer.

Due to the decreased chance of the tag activating, this is not optimal.

You can select the custom injection technique if your configuration mandates that the body> script be put in the appropriate tag. This plugin employs a workaround; therefore, you should test your website in several different browsers to ensure that everything continues to function as intended.

The GTM plugin has multiple data layers, which are often possible only through modifications.

For instance, we may communicate the post date, author, or title to the data layer using the Basic tab. These data points can be used to feed our analytics tool. You should probably look at the Integration page if you use plugins like ContactForm 7 or WooCommerce. Being able to use Google Analytics Enhanced E-Commerce Tracking without having to set up the data layer yourself is convenient. Additionally, the plugin may inject the Google Optimize Page Hiding Snippet to ensure the success of your trials.

How do I check whether the Google Tag Manager in WordPress is properly installed or not?

The GTM configuration can be checked in the following ways:

  1. Built-in GTM Preview and Debug Mode

Open your Google Tag Manager account and hit the ‘Preview’ button.

Now your browser will be in a different state, analyzing your website. A pop-up dashboard will appear at the bottom of your screen. Refresh the page on your website to see whether this really happened. If so, you have correctly installed GTM. Just to be certain, turn over a few pages.

  • Source code checking

The second way to check the GTM installation is by testing the source code of the website. For this,

Check the page source of your website to determine if the scripts have been included in the head portion of the HTML, just below the opening tag.

To do this, select View Page Source from the context menu of your right-click. You might now go through other pages to see if it has been included in the HTML, but we can also assist ourselves with a few tools.

  • Check with the help of Google Tag Assistant Extension

Google Tag Assistant is the tool that is specifically generated to test whether the Google Tag Manager is installed properly or not.

Install it and press the icon ‘Google Tag Manager’ to open it. Here you need to view the Google Tag Manager that is installed.


How do I install GTM on WordPress?

There are two methods to install GTM on WordPress.

  1. Edit the code snippets
  2. Use a GTM plugin

Are there any GTM installation plugins available in WordPress?

Yes, Tamas Geiger's "Duracell Tomi's Google Tag Manager for WordPress" plugin is one that is suggested. It offers simple installation along with other features like Google Analytics Enhanced E-Commerce Tracking and data layer connections.

Can the theme be edited to install GTM in WordPress?

Yes. While customizing the theme, you are allowed to include the GTM container code. Also, you can have a WordPress child theme.


You can follow the instructions that we have studied in this article to install Google Tag Manager on your slick WordPress website. Now that you have everything set up, you can begin deploying your tags with Google Tag Manager. We hope you find this article useful for monitoring and analyzing your website's movements and activities.

The WordPress theme bundle integrated with Google Tag Manager offers a streamlined solution for website owners and developers to manage their tracking codes and analytics scripts effectively. By seamlessly incorporating Google Tag Manager into the bundle, users can effortlessly implement, update, and control various tags, such as tracking, marketing, or analytics, without the need for extensive coding knowledge. This integration not only enhances the overall user experience but also ensures accurate data collection and improved performance tracking. With the WordPress theme bundle and Google Tag Manager synergy, website management becomes more efficient and adaptable, enabling users to focus on their content and business strategies while maintaining a robust and organized tracking framework.

Back to blog