Why doesn’t Google Analytics data match Google Tag Manager previewer when debugging?

Author avatar

Emma Barnes

What do you do when…You create a tag via Google Tag Manager, use the GTM previewer to debug it, GTM tells you “that’s working!” – but when you publish the new container and try to view the results of the tag, it just isn’t pulling in the right data or any data at all?

Seems unfair, doesn’t it?

I don’t know if this is a bug in GTM or if it will become “fixed,” but hopefully this post might give you some guidance about what to do.

Example – Fjellsport

This example comes from Christian at Fjellsport (the largest outdoor online store in Norway) which came about after trying to implement internal site search tracking.

Christian wanted to implement a tag for instances in which someone searched on Fjellesport, but their query returned no hits. He created a Google Analytics Event Tracking tag that fired on DOM Ready and returned either “hits” or “no hits”, depending on the search query result.

When he searched for a rubbish search query and ran GTM previewer, it showed that the tag had fired with the event category “no hits”, which was as expected.

Google Tag Manager Event Category

However, looking at Google Analytics, this search string (and other garbage strings) was pulling in as “hits”.

Google Analytics hits

Returning to the GTM Previewer, you can see on the left-hand side we are observing the “Summary” of the tags that have fired.

The left-hand display shows everything that has happened on-site (with regards to GTM) since the pageview began, with the most recent action at the top. You can see that it goes:

  1. Page View
  2. Message
  3. DOM Loaded
  4. Window Loaded
  5. click

In the case of this tag, it was supposed to load on “DOM Loaded” so I clicked “DOM Loaded” on the left-hand side to see what actually happened when the DOM loaded.

DOM loaded in Google Tag Manager

You can see that on “DOM Ready” the Action type is indeed “hits”, which is why Google Analytics is pulling this in.

I explored the next step after “DOM Loaded” which is “Window Loaded”, and if you switch to “Variables” and look at the variable called “EMMA – HitsNoHitsConfig” (which is the variable that we were using to create the Event Action), it says “No Hits”.

Window Loaded in Google Tag Manager

Now we have discovered what needs to be amended – the variable works, but it’s the trigger that’s incorrect.

Solution: Change the trigger from “DOM Ready” to “Window Loaded”

What if this happens to me?

Every case is different, but here are some things you can check:

  • Is your container published?
  • Is the tag paused?
  • Are the firing conditions correct?
  • If using GA, do you have a filter that may overwrite the data coming in?
  • Is there another tag that may interfere with this tag (for example, due to firing order)?
  • Is Google Tag Manager installed correctly?

If none of these things help solve your mystery, please feel free to get in touch.

Bath

+44 (0) 1225 480 480

20 Manvers Street

Bath

BA1 1JW

Leeds

+44 (0) 113 260 4010

2nd floor, 2180 Century Way,

Thorpe Park,

Leeds, LS15 8ZB.

London

+44 (0) 113 260 4010

5th Floor, Cordy House,

91 Curtain Road

London, EC2A 3BS

Part of the St. Ives Group

  • By pressing submit you consent for Edit to contact you via your email or telephone number for purposes relevant to your request for our goods or services. Your contact details, including your name, company, telephone number and email address will be used by Edit. By contacting you are agreeing to Edit’s Privacy Policy. If you have any questions, please ensure you review this section before submitting.

  • This field is for validation purposes and should be left unchanged.

© 2018 Edit. St Ives Group. Company reg. no. 3624881, All rights reserved. VAT Registered GB 927458295 Privacy Policy | Terms & Conditions | Cookie Policy