How to Install Google Tag Manager in WordPress in 3 Quick Steps and Plugin Recommendations

Google Tag Manager is a free tracking tool that allows you to manage and deploy tags without editing your website code.

It is the most popular tag management system used by many websites. It not only offers easier tag management with little code usage, but also faster page load time and a smoother workflow. Also, its preview mode allows you to check if your tags and triggers work before publishing them.

Google Tag Manager also has tag templates integrated with Google Ads, Google Analytics, and other third-party tools. As a result, you can easily manage your tags through a control panel to improve your digital marketing strategies.

This article will walk you through installing Google Tag Manager in WordPress, both manually and with a plugin. We’ll also list five Google Tag Manager plugins and alternatives that you can choose from to enable advanced tracking on your .

How to manually install and configure Google Tag Manager in WordPress

There are two methods to install Google Tag Manager in WordPress: manually and with a plugin.

Although using a plugin may be easier, the manual method gives you more customization options on top of the code. For this reason, we recommend opting for the manual method for advanced users.

1. Create a Google Tag Manager account

First of all, you have to create a Google Tag Manager account. Follow these steps:

  1. Open the Google Tag Manager home page. click on start for free and sign in with your Google account.
  2. click on Create Accountat the top right or the icon in the center of the page.
  3. In Account settings, you will have to fill in the name of your account. We recommend that you use your company name if it is for your business.
  1. Fill in your domain name and choose Web as a destination platform Container Configuration.
  2. When you have filled in all the information, click To create.
  1. Next, the Terms of Service Agreement window will appear. Read the information carefully and check “I also accept the Data Processing Conditions according to the GDPR”.
  1. click on Yes to create your account.
  2. Finally, you will see a pop-up with two Google Tag Manager code snippets for your website. The first is for the header, and the second code snippet is for the body section of your website. To copy these code snippets, simply click the copy icon.

2. Add the tracking code to WordPress

The next step is to add the code to your WordPress site. To do this, follow these steps:

  1. Login to your WordPress account and go to Tools -> Theme File Editor in your sidebar.
  1. On the right side, check the Theme Files.
See also  How to use HeidiSQL to connect to a MySQL database

As WordPress themes vary in terms of design and functionality, they can have different types of files. Some typical files are functions.php, footer.php Y header.phpbut they can have different names.

The header file, which is usually called header.php, is where you will make the changes with the Google Tag Manager code snippets. If you can’t find header.php in your WordPress theme files, contact the theme developer for more information.

  1. After copying the Google Tag Manager code snippet, click header.php and locate the labels Y to change the header section. Normally, you can also customize the opening tag in the same file. However, other themes may have the body section in a different template file.
  1. Paste the first code from the header section as high as possible in the of the page.
  1. Also, paste the second code after the start tag .
  1. click on update file at the bottom of the page to save your changes.
  2. Once you are done adding snippets to your WordPress website, go back to your Google Tag Manager dashboard and click Preview.
  1. It will take you to a new window to connect Tag Assistant to your website. Enter your site URL and click Connect.
  1. A new window will open to your site, and Tag Assistant will notify you that the connection to Google Tag Manager was successful. click on finishnavigate to the preview window and click Continue.
  1. You will see the notification “Google container found” along with your Google Tag Manager container ID, which means that the installation of Google Tag Manager on your WordPress website is complete.
  1. Close the preview window and click Send.
  1. Then enter the version name. For example, you can call it “GTM in WordPress”. then click Post.

3. Post a new tag

You’ll need to create a tag to start using Google Tag Manager to track user behavior. To do this, follow these steps:

  1. Access your Google Tag Manager dashboard and click Add new tagwhere you can choose from more than 50 tags compatible with Google Tag Manager.
  1. Click the icon to choose a tag type.
  1. Below, you’ll see many types of tags featured in the list, including several Google Analytics tags. You can choose the Universal Analytics tag if you have a Google Universal Analytics account.
  1. For him Tracking Type, select the element you want to track on your WordPress website from the list. Also, select new tag for Google Analytics configuration.
  1. Next, a variable configuration window will appear. Enter your Google Universal Analytics Tracking ID, change the variable name and click Save. You can find your tracking ID in the tab adminin Property -> Tracking Information.
  1. Then skip to the next section to choose a trigger.
  1. Check the triggers you want to use and click Add.
  1. Then rename the tag and click Save. Before publishing your tag, use the preview mode to check if the tag works on your website.

That’s it – you have successfully created a Google Analytics tag.

Professional advice

Google has announced that it will stop working in July 2023, and that Google Analytics 4 will replace it. Therefore, we recommend that you start using Google Analytics 4 earlier to export your files before losing access to Google Universal Analytics. This tutorial will also reference the Google Analytics 4 tag type as an example.

If you already use a Google Analytics 4 account, choose Google Analytics: Label of GA4 configuration in Google Tag Manager, and click Save.

Unlike Universal Analytics, you will need to enter your Measurement ID in the tag settings. To get it, first set up a data stream in the Properties tab of your Analytics.

click on Save and you can continue with the steps we have explained to configure a trigger for the Universal Analytics tag.

Now that you’ve set up a Google Analytics tag, you’ve completed the steps to manually install Google Tag Manager on your WordPress site.

How to add Google Tag Manager in WordPress with a plugin

The second method of installing Google Tag Manager for WordPress is via a plugin, which is a more suitable option for beginners.

You should start by following the steps to create a Google Tag Manager account explained in the previous part.

Add the tracking code to WordPress

With , adding the tag manager code will be easier, since you don’t need to locate template files and manually add the code snippets to the tags. Y .

We will show you how to install Google Tag Manager on your WordPress website using the plugin as an example.

  1. Once you’ve created a Google Tag Manager account, navigate to your WordPress admin page. go to Plugins -> Add NewFind the Insert Headers and Footers plugin and click the button Install Now.
  1. After that, navigate to Settings -> WP Headers and footers. You will see its configuration settings where you can add Google Tag Manager code.
  2. Copy the code snippets from your Google Tag Manager account and paste them into the boxes.
  1. click on Save when you’re done.

Next, follow the steps to create a Google Analytics tag explained above, and don’t forget to check through the preview mode before publishing the tag.

5 Best Google Tag Manager Plugins and Alternatives

You can also use a plugin to make Google Tag Manager setup easier and have extra functionality. However, with so many Google Tag Manager plugin options available, it can be difficult to choose the best plugin for your WordPress site.

To help you decide, we’ve put together a list of the top five Google Tag Manager plugins and their alternatives based on their features, rating, and price.

1. Monster Insights

Plugin Statistics:

  1. Downloads: More than 3 million
  2. Assessment: 4.5/5
  3. Better for: company websites, e-commerce stores, publishers, developers, and agencies
  4. Price: freemium ($99.50-$399.50/year)

MonsterInsights is a plugin that allows you to track your website analytics from your WordPress dashboard. With this WordPress plugin, you can set up advanced tracking across devices and campaigns without having to code.

Therefore, it is arguably the best alternative to Google Tag Manager, especially when managing a business website. MonsterInsights is an all-in-one tool where you can enable tracking, data analytics, and custom reporting.

To use this plugin, you just have to install and activate it and follow the steps of its quick setup wizard. Just fill in your business and supporting information, and then connect with your Google Analytics account. With MonsterInsights, you don’t need to visit your Google Analytics dashboard to make changes.

main features

  • Tracking links and buttons. Track clicks on links and buttons without the need to set up tracking and coding to optimize your digital marketing strategies.
  • Form conversion tracking. You don’t have to create tags to track the performance of your forms like in Google Tag Manager. Simply install their form plugin, and the plugin will be able to track your form performance.
  • Ecommerce performance tracking in a few clicks. To activate this feature, you will also need to install its plugin. It will be easier to track conversion source, revenue, product performance, and other metrics in Google Analytics with the…
Loading Facebook Comments ...
Loading Disqus Comments ...