How do I Setup Google Tag Manager for WordPress?


Understanding your audience is a major part in determining the success of your website. If you have a general idea about what content your audience looks for on your website and what content on your website is more successful, you’ll have an easier time improving these factors and gain more success.

For this purpose, many tools have been created to help you collect and compile this information and use them accordingly. However, these tools vary in purposes, and use and managing them collectively can be quite difficult.

So, Google has created an amazing tool to help you manage all these tools in the form of Google Tag Manager. Google Tag manager works by letting marketers set website tags collective and manage them. This gives website owners the power to manage JavaScript and HTML snippets and tags used to add various products, tracking features, and more.

What is Google Tag Manager?

Google Tag Manager (in short GTM) is a Tag Management System (in short TMS) that allows you to quickly and easily update measurement codes and related code fragments collectively known as tags on your website or mobile app.

Once the small segment of the Tag Manager code has been added to your project, you can safely and easily deploy analytics and measurement. As well as, tag configurations from a web-based user interface.

Setup Google Tag Manager for WordPress




When Tag Manager is installed, your website or app will be able to communicate with the Tag Manager servers. Whereby, you can then use the Tag Manager web-based user interface to set up tags. As well as, establish triggers that cause your tag to fire when certain events occur. And also create variables that can be used to simplify and automate your tag configurations.

A Tag Manager container can replace all other manually-coded tags on a site or app. Including tags from Google Ads, Google Analytics, Floodlight, and 3rd party tags. With this in mind, you can read and learn more about: How does Google Tag Manager work?

Why should I use Google Tag Manager?

Google Tag Manager is an extremely resourceful web tool that lets you add useful snippets to collect and send data to other third-party tools. These third-party tools include AdWords conversion tracking, DoubleClick floodlight as well as Google Analytics.

Google Tag Manager allows you to easily allow these snippets to work on your website, manage its data accordingly, and delete them if necessary. Google Tag Manager or GTM for short, works by providing an interface to manage these snippets easily instead of requiring you to modify their code directly.

Thus, here’s where the need for Google Tag Manager comes, instead of hard-coding the snippet codes and requiring tough changes in order to modify data tracking, you can simply use GTM to separately create tags and add them, all without barely any understanding of HTML.

Using analytic and tracking tools are made much easier, especially for beginners by the use of Google Tag Manager. So, let’s talk about how to integrate this into WordPress.

How do I Setup Google Tag Manager?

First of all, let’s sign up for Google Tag Manager and register an account for your website. For this, open the website and click on Sign up to start a new account. <link>



Login with your Gmail id and the website will refer you to the new account page. Here places the name of your account. Then select the country your organization or business is based on.



Click on the Share Data anonymously option to allow you to send the data to Google while still hiding your website’s private details. This allows Google to save data from multiple websites, create benchmarks for comparisons, and improve the service as a whole.

Then click on Continue.

Next, you will insert your container name. This is generally your website’s name. Select your container as Web and click on create. Then accept the agreement by clicking on Yes on the top right to create your GTM container.



A set of codes will be provided to you, however, keep this copied for now as it will not be much of a use right now.
Creating tags for Google Tag Manager

Now we need to set tags for various tools for your website. First, open your Google Tag Manager dashboard.

Click on Add New Tag to start.



Then, in the new window, click on Choose a tag type. Here you can select what type of snippet to create, for demonstration let’s use Universal Analytics for Google Analytics.



In the tag configuration menu, choose the Track type. For example, every page view triggers the tag for Google analytics. This trigger can be changed using Track type.



Next, click on the Variable type/Google Analytics settings menu and choose the New variable type.

Set your tracking ID in the Tracking ID field. This will be provided to you if you sign in for Google Analytics individually using your website. To learn about this tracking code and Google Analytics as a whole, refer to here.





Then click on save to create the new variable settings by naming it down. Choose this new variable that you just named.

Now for Triggering, you can choose what pages trigger the Google analytics tag. For now, we will select All Pages. Furthermore, you can insert the exceptions and choose what pages do not trigger the tags. Once done, name your Tag and Click on Save to create your tag.



Now we need to copy our containers onto our WordPress website to start tracking. You can use the code we saved at the start but if you need to find it again, you can do it by using the Admin settings.

Simply click on Admin and then Click on Install Tag Manager. Then copy the two separate codes provided to you.



We need to insert these codes into all our pages in order to start tracking.



The first code uses javascript for tracking while the second one uses iFrames. This means if a viewer has disabled Javascript the second code is used for tracking.
Enabling Google Tag Manager

Now we insert these codes into our WordPress website. For this, simply open your WordPress theme editor and manage the Header.php template.

First, go to your WordPress admin dashboard and hover over Appearance. Then click on the editor to open your theme templates. On the far-right list of Theme files, scroll down and click on Theme Header.



This is your header.php file and here we will insert the Google Tag Manager's container code. Take both the codes we saved earlier and copy them right under the “<Body>” section.



This should enable Google Tag Manager on all your pages.

To check whether GTM functions well, open Google Tag Manager on a tab and enable Preview mode on it. Simply click on the Preview on your Google Tag Manager workspace window.



Once this is enabled, open your website in a separate tab and Google Tag Manager should show you a debug window.



Thus, you can easily enable various Tags and analytical tools on your website. You can add more tags for DoubleClick Floodlight, AdWords, Google Optimize in a similar way by simply adding newer tags in the Workspace window.

Summary:

Using these steps, you can enable Google Tag Manager and tons of other useful tools on your website to study your demographic tools. These tools allow you to easily improve your website by studying what kind of content to focus on and what products to sell.

Furthermore, do remember that the enabling tag still requires you to have these tools enabled and requires you to use their respective IDs and codes.


Comments

Popular posts from this blog

What are SEO Best Practices?

How does Mpgun work?

How do I stop Windows 10 Automatic Updates?