
August 25, 2020
What to do if Event Tracking in Google Tag Manager is not working?
Updated: August 25th, 2020.
Google Tag Manager empowers you to track various events on a website and then send that data to tools like Google Analytics where you can analyze. In many standard cases, you can track those events without the developer’s input. However, sometimes you might get stuck when your event tracking is just not working.
While trying to help students of my courses and readers, I’ve noticed some problems that are more common than others. Since I am always advocating for helping at scale, writing troubleshooting guides like this one can definitely help with that.
In today’s blog post, we’ll take a look at the most common issues why your event tracking in Google Tag Manager is not working.
By the way, if none of these tips work for you, let me know in the comments. Describe your problem as detailed as possible (with link to screenshots) and I’ll try to help (and also update the blog post accordingly).

Table of Contents
- #1. Broken data layer
- #2. You haven’t created a trigger
- #3. Using the wrong trigger
- #4. Dealing with an iFrame?
- #5. Trying to use the built-in Form Submission trigger?
- #6. dataLayer.push does not include the event key
- #7. Typos (+ case-sensitive)
- #8. Youtube trigger not working?
- #9. The tag is firing but you can’t see the data in GA Realtime reports?
- #10. Don’t forget to publish your container
- #11. Hijacked ga() method
- Is Event Tracking in Google Tag Manager still not working?
Video tutorial
Prefer video content? Here’s the video about this topic on my Youtube channel.
#1. Broken data layer
Event tracking in Google Tag Manager is relying on the Data Layer. However, a careless configuration on your site might break it.
How can you know whether the Data Layer is broken on your site? Enable Preview and Debug mode and then check what events are displayed on the left side of the debug console.
Normally, you ALWAYS must see AT LEAST 3 events in the preview mode:
- Pageview
- DOM Ready
- Window Loaded
If, on the other hand, you see just the DOM Ready and Window Loaded, and instead of the Pageview you see a mysterious Message, you have a problem.
If this is exactly what you see, read this guide on how to fix the Data Layer.
#2. You haven’t created a trigger
This applies to the situations where you are trying to use the built-in triggers in GTM, like Just Links, All Element Clicks, or Form Submission (but not limited to).
Some GTM beginners just enable the related variables (e.g. Click ID, Click Text, etc.) and hope that they will start seeing Click events in the Preview and debug console. However, that is not enough.
You also need to have enabled a trigger to start seeing events in the preview mode (this applies to the built-in event tracking functionality of GTM). So, if we are talking about the link click tracking, you need to complete both steps:
- Enable click-related variables
- Have at least on Just Links trigger enabled on a page (any condition will work)
If you are interested in All clicks, then have at least one enabled All Elements Clicks trigger, etc.
Once you have done that, refresh the preview and debug mode and then interact with the element. Now, you should see that event in the preview console.
#3. Using the wrong trigger
Sometimes, you might be using the wrong trigger to track a particular interaction. Here are several examples.
#1. You are trying to track clicks of an element with a Just Links trigger but that element has no link.
You can inspect that element (Right Click on it > Inspect) and check whether that element is surrounded by <a> tags. If not, this element cannot be tracked with a Just Link Clicks trigger.
#2. Trying to use a Youtube Video trigger on a non-youtube video player
As the trigger name implies, it supports only Youtube video players. If you are dealing with the Vimeo, generic HTML5 player, etc., read this guide.
#4. Dealing with an iFrame?
Chances are that you are trying to track interactions of an element that is in the iframe. In a nutshell, iFrames allow embedding HTML documents on a site. That document can contain just a button, a video player, a reservation form, even the entire website).
The contents of the iFrame can belong to your site but also can be hosted on a totally different domain.
Here’s the catch about iFrame tracking: even though you, as a website visitor, can interact with it (click, scroll, etc.), JavaScript on the parent page (including GTM) cannot “see” what is happening inside of that iFrame (unless you have access to the source code of what’s inside that iFrame).
Here’s a situation:
- You are working on mywebsite.com
- And there is a page on your site (mywebsite.com/contact) that contains a form (originally hosted on someotherwebsite.com)
- That form is embedded in an iFrame
- Your GTM container snippet is implemented only on the mywebsite.com and the iFrame does NOT offer the opportunity for you to add some custom code inside of it.
If you are dealing with this situation, you are most likely out of luck and will not be able to track events within that iframe (there are some exceptions, though).
If, on the other hand, you (or your developers) can add some custom code inside that iframe, then you should read this guide.
After reading this chapter, your questions might be:
- How do I know if I’m dealing with an iFrame?
- How can I know if I can add my code inside of that iFrame?
Let’s address them both.
#1. How do I know if I’m dealing with an iFrame? Do the right click on the element that you are trying to track and then in the Elements tab, climb up until you find the <iframe>
If you found it, that’s an iframe. If you haven’t, then the reason why event tracking in Google Tag Manager is not working lies somewhere else.
#2. How can I know if I can add my code inside of that iFrame? Several options:
- Talk to your developers and ask if it’s possible
- If that embedded iframe form (or whatever) is offered by a 3rd party vendor, contact their support and ask whether it is possible to place your custom JavaScript codes inside of it. If yes, then continue with this article. If not, you are out of luck (if there is no JavaScript API).

#5. Trying to use the built-in Form Submission trigger?
If you are trying to track a form on your website and you are using the built-in GTM Form Submission trigger, there are many reasons why it does not work. Read this blog post where I explain everything in greater detail (+ offer solutions)
#6. dataLayer.push does not include the event key
If you want to fire a tag on any dataLayer.push, that push must include an ‘event’ key, for example:
window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event' : 'formSubmitted' });
Then you could use a Custom Event trigger and activate your tag. If, on the other hand, the dataLayer.push does not include ‘event’, all you will see in the Preview mode is Message.
Even though it added some data to the Data Layer, you cannot use Message push as a trigger condition.
#7. Typos (+ case-sensitive)
A lot of things in Google Tag Manager are case-sensitive. For example, this means that productid ≠ productID. Keep that in mind when you create triggers. For example, you see a custom dataLayer.push where the ‘event’ key is ‘formSubmission’:
window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event' : 'formSubmitted' });
If you created a custom event trigger like this:
it would not work (because you need to use uppercase S).
Also, triple check for typos. For example, if you want to access the attribute key in the dataLayer (I just made that example up), then make sure that you don’t skip any letter (and enter something like atribute (with one “t’)).
#8. Youtube trigger not working?
Are you trying to measure the engagement of your embedded Youtube video player but don’t see any video events in the GTM preview mode? You are not alone. In fact, there are many possible reasons why this is not working. I’ve posted another guide dedicated just to that problem.
#9. The tag is firing but you can’t see the data in GA Realtime reports?
This happens also pretty often. Looking at the GTM preview mode, everything seems to be fine, right? The tag is firing exactly when you expect it to happen. However, when you go to GA > Realtime, that event is not visible. Why?
There are many possible reasons (like GA filters, some configuration in GTM, etc.). To help you troubleshoot this, I’ve posted a blog post some time ago.
#10. Don’t forget to publish your container
Once you have checked whether your events are being tracked properly, don’t forget to publish the GTM container. While you’re in the preview mode, you will see your data in GA properly. However, the rest of your website traffic is still not being measured.
That’s because other visitors are not seeing the preview mode. If you want to make your changes public, you need to publish your GTM container.
To do that, click SUBMIT in the top right corner of your GTM interface and follow all the necessary steps. After you do that, you will start seeing events coming in from all the visitors of your website.
#11. Hijacked ga() method
This tip comes from Simo Ahava’s blog.
Even if it looks that your tag has fired, take a closer look at the preview and debug mode. If you expected the tag to fire on the “Scroll Depth” event, click that event in the preview mode and then check what is the status of the tag. Is it “Still running”?
If yes, this means that the request to Google Analytics was not sent. There three possible reasons for this:
- You inserted the GA Settings Variable into a wrong field (you can read tip #1 here)
- The ga() method is hijacked
- Non-existent Google Optimize container is loaded on the site (you can read about it in Simo’s guide)
I will focus on the 2nd reason.
There is a chance that some other code/tool has overwritten the global ga() method that is used by Google Analytics. This means that GA setup is just broken and no hits can be sent.
Let’s check if this is your case. Open the JavaScript console in your browser and enter the following command:
console.log(window[window['GoogleAnalyticsObject']].answer);
If it returned 42, you’re good and the problem is lying somewhere else.
If it did not return 42 but something else (most likely undefined), your ga() method has been hijacked.
How to fix it? You can define another Global Function Name in GTM. This must be done in all GA tags, therefore, use GA Settings Variable for that.
Is Event Tracking in Google Tag Manager still not working?
There are many more possible reasons why your event tracking is not working, however, I wanted to point out the most common ones that I face while helping my students.
If none of these tips helped you, let me know in the comments. Maybe I forgot something to mention or maybe you are facing some new edge case that I should definitely include in the list?
Many of these tips are rookie mistakes. If you want to avoid them and get better with Google Tag Manager, consider downloading my free e-book for GTM beginners below.

19 COMMENTS
The variables are not showing in the debug mode, it fires the event but not if i set it for specific class :(
I am not sure I understand. Please explain.
I have a page created in Wordpress. When I search for a plugin to track events, several are displayed.
Could you recommend a specific one?
Hi Julius. Thanks for the article. I have one major issue with my datalayer variable. Currently I have a datalayer push
" <script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({'Topic': [{'Digital Design'}]});
</script>"
I have created a DLV called "Topic" and whenever I check it on the debug mode I get "undefined". What can I do to rectify this?
So, I am running into the opposite problem. When using Tag Manager Preview mode, I can see my event firing, and it appears in Goggle Analytics Real-time window. However, that realtime data is not being saved in "Behavior > Events > Overview" so my record of events only exists for the 30 minutes it is visible in the realtime window.
You need to wait for up to 24 hours to see data in Behavior > Events > Overview
Hey Julius,
Nice article, and great chapter of the course.
But, I would need an idea for the following challenge, maybe you have s.th. in your mind:
There are several iframes on the page of a customer of mine. These have different URLs, so do the different pages on the parent-domain.
Do you think it is possible to have only the domain as childOrigin/parentOrigin? Thank you for spontaneous ideas.
Events are working in preview but GA dont recieve data of this events
Hi Julius,
I am facing one new challenge. I trying to track the event - download button clicks.
This event is firing successfully in preview mode, but it's not appearing in google analytics real time window or analytics not receiving any data of this event.
what can be the reason? kindly help me with the solution.
https://www.analyticsmania.com/post/google-analytics-real-time-reports-not-working/
Hi Julius, in problem #1 - when I am in debug I see 3 of the following:
- Container Loaded
- DOM Ready
- Window Loaded
So Container Loaded appears instead of Pageview.
That's ok
Hi there,
Thanks for the article.
this concerns the Ecommerce tracking.
My site does not show a dataLayer at all. (when you click on view page source)
Therefore the tag does not fire as well.
Do you know what the problem might be causing?
Kind Regards,
Marloes
Hi, difficult to tell you specific reason without seeing the full setup.
Hi Julius
I am testing Click - All Elements and none of the clicks are firing. The Links works fine?
I was one of those who literally checking in the real time reports. While on debug mode, the tag and triggers are firing correctly but no event is recorded in the real time reports in GA. Then, I checked the 'Events (Last 30 min)' the event I set was there! Thanks for this informative article Analytics Mania!
Hi Julius,
I'm experiencing really odd behaviour with my GA4 events. The events are within an iframe and all events are fired successfully from GTM. From GA realtime, I see my events fire successfully, but only on a unique visit, after which no custom events appear (only the in-built page_views etc). If I open the app in an incognito/private window and click on those custom events it shows up in realtime, against on the initial visit. After refreshing the incognito page and testing the custom events again? Nothing. Can't tell if it's a cookie impeding subsequent visits.
I tried console.log method from #11 and got back a TypeErorr "Uncaught TypeError: Cannot read properties of undefined (reading 'answer')".
I'm also not sure where to apply the associated fix within GTM. If you could please elaborate on the application I can see if this fixes the issue.
Kind regards
Hi Julius,
Thanks for your informative blog.
I am set up a "reservation submit event" tag which is firing on GTM but events are not showing up on Google Analytics.
I checked everything, Javascripts are returning 42. I created page view event with the same settings, I am able to see those on GA but not "custom event" based events.
Do you know what might be the reason?
Difficult to tell without doing an audit of your setup