Google Tag Manager for SEO – Guide to Improve Rankings with GTM

Google Tag Manager for SEOSuccessful search engine optimization doesn’t happen overnight. We need to monitor our website constantly and that’s when Google Tag Manager for SEO can be really useful.

Keep reading!

We’ll explain in detail how to set up GTM and optimize your page to rank higher on SERPs.

GTM & SEO – tell me more!

We need to measure how the website is performing, how much traffic we are getting, assess how the advertising campaigns are performing and also how users are interacting with our website.

That being said, User experience and User behavior are one of the top ranking factors for Google.

If you look online, you will find many tools to track all these data. Google Analytics, Hot jar, Crazy Egg and so on, the list is endless. But in all of them, Google Analytics is a standard and universal platform which is used by millions of people for tracking and monitoring data.

As you may know, Google Analytics is a free tool offered by Google. This tool collects some of the essential data by default, such as, the geolocation/country of a user, how much time they have spent on your website, how many pages they have visited, etc.

However, by using Google Analytics, you won’t be able to track information such as the links/buttons clicked by individuals, how long they have seen any video or form submitted by any user.

You would need to hire developers to track such data using JavaScript. This situation often ends up slowing down your website or incorrect tracked data because of the lack of development resources.

In this case, Google Tag Manager for SEO is all you need.

But before we jump into its different uses for SEO performance improvement, first let’s discuss how to set it up correctly to fire any tags.

Note: In this tutorial, I am going to show you how to track button clicks. This same procedure can be applied to track any events (it can be a button click, link click, form submission or video watch time). To track different event, all you have to do is change the variables.

Step 1: Create a Tag manager account and add a container.

Create Tag manager account and add a container

Go to Google Tag Manager and click on create a new account. The new screen will pop up with the following data,

  1. Add your account name or business name.
  2. Add your website address for container setup and where to use it.
  3. Accept terms and condition.

Installing Tag manager in a website.

After you have created Tag manager account you will be presented with the following screen containing the code. You need to insert the first code in the header as high as a possible and second code at the starting of the body.

Note: If you are using WordPress then I advise you to use a plugin called “insert header and footer” because it is very easy and efficient to manage all the codes. In the below screenshot you can see I have added the second code in the header using body tag.

Step 2: Create a variable.

We want to track button clicks so we are going to select the “Clicks” variable in the Tag manager. If you want to track any other event then select the variable accordingly.

Now go to Variable and then click on Configure.

Google tag manager uses different CLASSES and their IDS to identify any buttons. To identify all the associated classes with a button select all the options as shown below.

Don’t select any other variable except click variable when tracking button clicks.

Step 3: Create a trigger.

Now let’s say you want to track clicks on a specific button. In my case, I want to track clicks on the contact us button on my website.

Go to Trigger<Add New<All Elements.

In that option select “All Clicks” and Save it.

Step 4: Identify Classes.

In the previous step, we have selected “All elements” to find out a specific Class associated with our button. Now we need to find out that specific class.

Now click on the preview button located at top right corner in the main screen.

After that open your website. After opening your website you will be presented with the following screen.

Here I want to track clicks on the send button. So by clicking on the send button following variables shows up as you can see in the below image.

Now there are two variables which contain a value. You can select any one of them and set it in the tag manager. I am going to select the first one named ‘wpcf7-form-control wpcf7-submit’.

Step 5: Set the Class.

In tag manager click on the triggers. Previously we have selected the “All Clicks” in “All Elements” menu. Now change it to “Some Clicks” and add the value we have identified from our site.

My trigger was “Click Classes” which contained the value “wpcf7-form-control wpcf7-submit”. So I added it in the trigger and saved it.

Step 6: Test the Trigger.

Now that we have selected the trigger it is time to test if our trigger works or not. In order to do that we need to create a custom HTML and test it.

Go to Tags<Tags Configuration and select “Custom HTML”. And add the following code (<!– –>) in the box and save it.

Now go to the website and click on the targeted button and you will see the message displaying “Custom HTML- Succeeded”, which means your trigger fires successfully.

Step 7: Create a Tag.

In the previous step, we tested our tag and it works correctly so now we need to save our results in Analytics.

In order to do that we just need to change our previous element (Custom HTML) to Universal Analytics.

Now go to, Tags<Click Element (our generated tag in step 6) <Choose Universal Analytics.

Select “Event” in the first drop-down menu, then for the rest of the option you can choose any name you will comfortable.

Now if you scroll down, you will see the option named “Google Analytics Settings”. In that option select this option {{ Google Analytics Settings }}. And in the Triggering option select the trigger we have created earlier in step 5.

And then click on the (i) button and you will be redirected to the following screen. In that following screen, you need to add analytics ID of your account and save it.

Now you will be redirected to the main menu. At the top right corner, you will see a submit button, after clicking on that you will be presented with a below screen and then click on the publish button.

Step 8: Check if the event tracking shows up in Analytics or not.

Now that have followed above steps successfully, we need to check whether the event tracking works or not in the Analytics.

If you click on your targeted button you will see the new click (shown in the below image) in the “Event section” of Analytics.

You can use this same procedure to track anything on a website using Google Tag Manager.

Now let’s discuss some of the SEO benefits of Tag manager.

Improve the CRO of your website.

I didn’t know this until one day when I was experimenting with the tag manager and came to know about how you can improve the CRO of a website.

I implemented the tag manager on my client’s website and I was tracking user behavior. My client’s website offers different software development solution and they rely on organic traffic to generate leads.

One of the great advantages of Tag manager is, you can see all the pages visited by a user who has clicked on your targeted button. I never cared about pages like Certification, Infrastructure,

Engagement Model, and Confidentiality on my client’s website.

Then when I checked the tag manager data I was surprised to see that many of the users visited those certain pages(above-mentioned pages) after clicking specific buttons.

So I updated all of those pages to increase the conversion ratio.

Other than that you can track clicks on any buttons/links. And monitor how many organic visitors have clicked on your targeted button and improve your content accordingly. You can use this technique on any type of site(let it be Amazon affiliate website or lead generation website).

By using this technique you will be able to know if you need to change the Call to Action on your website or not. On top of that, you can run A/B tests to track the user behavior and user experience using this technique.

Sanitize your content with structured data injection.

Structured data is very important for SEO as it will help understand the search engine, what your page is all about.

This markup can be implemented using many formats such as JSON-LD, Microdata or RDF. Google highlights this data in the search results which increases the CTR of your website.

To use this structured data on your website you would need to insert the shortcode of snippet into your website’s header.

Now if you have a client with buggy CMS then it can become quite troublesome to insert this code into the CMS. But with the GTM this task becomes very easy, here’s how.

You can inject the shortcode of structured data into your CMS using the following method.

First of all, click here to generate Structured data for the specific webpage. Then copy the code and paste it into the custom HTML in the “Tag” menu. And select all pages for a variable and publish it.

Improve the accuracy of website traffic data.

SEOs sometimes require accurate traffic data when performing A/B tests or implementing some of the crucial changes on a website to get accurate results. The traffic from their own company or employees may affect the accuracy of data.

Basically, you can measure accurate data by applying filters in Google Analytics. But these filters are limited to 100. But if you have a large number of IPs to block then Analytics won’t work.

At that time you can use GTM to implement blocking triggers. Blocking triggers can be implemented using the Custom variable and custom trigger as I mentioned in the above tutorial.

After implementing the tag, GTM will block all the traffic associated with your targeted IP and you won’t be able to see the blocked traffic even using the unfiltered view.

Improve the site speed.

If you have implemented a custom developed tag and snippets on your website then it may slow down the loading speed of your website.

And above all, the custom developed tags may not be that efficient because they lack development resources. But instead, you can use the Tag Manager to implement such codes and track data efficiently.

The tag manager contains all the necessary features so you won’t need any custom development. And one of the greatest advantages of using GTM is, it only uses two codes

which won’t affect the load time of your site at all.

Implement the Self-referencing rel=canonicals tags

Most of the websites contain so many pages and in all them sometimes it becomes so hard to identify the duplicate pages. Even though you manage to identify them, changing them becomes another headache.

To prevent this situation altogether you can use self-referencing rel canonical tags on every unique page. This way the search engine will be able to determine the original page.

Now comes the best part. You won’t need to insert this code in each page. With the help of GTM, you can insert this code in all pages with one click.

You can check out this guide to generate and insert self-referencing rel canonical tags in all pages using GTM.

Final Thoughts.

Google tag manager is a great tool to track almost anything on your website. You can even improve SEO and CRO of your website using this free service, all you have to do is track the right information.

This tutorial is very easy to follow. Anyone can set up the trigger and track the data however if you have any queries or cannot execute all the steps then do let me know in the comments.


Author Bio.

Larry is an enthusiastic blogger and a digital marketer with many years of experience in the industry. He also owns a blog named trustedhints where he publishes fair and unbiased reviews of products. He likes to help the community by sharing his expertise with them

Leave a Reply

Your email address will not be published. Required fields are marked *