21 Most Common Google Tag Manager Mistakes
MD HEDAYETUL ISLAM
GA4 & GTM Pro | Google Analytics 4 ?? | Facebook Conversion API ?? | Google Ads ?? & E-Commerce Tracking ?? | GA4 Server-Side Tracking ?? & Cookie Consent Mode V2 ?? | Driving Data-Driven Marketing Success ??
If you’re reading this article, you’ve probably been in this situation: you open Google Tag Manager, set up your tags, triggers, and variables correctly (at least you thought so), and then it doesn’t work (or doesn’t work how you expected)! You even retraced every line in that 12-step tutorial, but still no luck.
Feeling frustrated and stuck, you call it a day with GTM. The following day, upon reopening GTM with a fresh perspective, you quickly realize there was an obvious mistake in the container (which you could have fixed in the blink of an eye yesterday if you had noticed).
Don’t worry—you’re not alone. Luckily, you can learn from the comprehensive list of Google Tag Manager mistakes (that we will cover in this article) to reduce the likelihood of this situation happening again!
## 1. Viewing the Wrong Google Tag Manager Container
Beginners and multitaskers often encounter this common error. If you find that GTM Preview and Debug mode is not working, this could be caused by the wrong GTM account/container.
If you track multiple websites and/or have access to numerous Tag Manager accounts, you might be using the snippet from another account or container (by accident, of course). Double-check whether the ID in your GTM account is the same as in the Javascript snippet that is hardcoded on the site.
## 2. The Container Is Not Published
So, you’ve set up a new project and configured the triggers, variables, and tags, but you notice that you’re getting too little data compared to what you expect. It’s almost as if tracking works only on your browser, but what about all the visitors to your site? This probably occurred because you forgot to publish the container.
Once you have updated or added some new elements to your GTM container, test your changes (using Preview and Debugview) and then push your changes live by clicking the “Submit” button at the top-right corner of the GTM interface.
## 3. Using a Data Layer Variable Before Its Respective dataLayer.push Occurs
Another common mistake is trying to access data before it’s available.
Imagine this: you have a tag that fires on the Initialization event. The tag uses a data layer variable that accesses the page_category key from the data layer.
So every time a page_view event is fired, you send the page_category to, say, Google Analytics 4.
But, here’s the problem – the page_data dataLayer.push (that contains the page_category) occurs after the DOM Ready. This means the page_category is not yet available on the Container Loaded tag. Therefore, you will always send undefined with the GA4 tag.
Understanding that you can only access a data layer variable after that particular data is available in the data layer is crucial. What options do you have in this case?
- Fire a tag on that particular dataLayer.push that contains the page_category key, or
- Ask a developer to activate that dataLayer.push code before the GTM container snippet is loaded.
## 4. Not Using the Preview and Debug Console Properly
When you select an event from the left column of the Preview and Debug console, the Tags tab will show the tags present during that event categorized into “Tags that fired” and “Tags that did not”.
This is where you should look for the answer to, “Why didn’t this tag fire?” GTM will only trigger the tag if all conditions of a single trigger are met. A red “X” icon indicates which conditions weren’t satisfied. Use them as clues and find out how you can fix the trigger.
If you want to learn more about proper debugging in GTM, check out this guide.
## 5. Not Using Other Debugging Tools
GA debugger and Data Layer Inspector are among the most popular debugging tools. Both are free Google Chrome extensions that will make your life infinitely easier.
The Data Layer Inspector is like a Swiss army knife that adds additional information to the browser’s console. It also allows you to temporarily inject the GTM container on any site, debug other analytics tools (including server-side setup), and more.
When it comes to e-commerce tracking, the GA debugger (together with the Analytics debugger) is irreplaceable to me. When enabled, it displays all data passed to Google Analytics 4, making troubleshooting much faster.
I have prepared a comprehensive list of Chrome extensions and tools for GTM. Take a look at this list here. I have also provided several tips for debugging here.
## 6. Not Checking the GA4 DebugView
I’ve seen many beginners not check their GA4 DebugView once they have implemented Google Analytics 4 tracking via GTM. There is a false perception that you have completed your task once the GA4 tag has fired (according to the Preview and Debug console).
However, that is very far from the truth because, in some cases, users might accidentally send data to the wrong Google Analytics 4 property (or maybe some other technical problem occurs). It is essential to confirm that you can see that data in DebugView, too.
When testing a new event, go to GA4 > Admin > Data display > DebugView. Here, you can see all the events that GA4 receives. Click on an event to see its parameters and user properties.
Lastly, there are other tools you can implement (e.g. Facebook Pixel) which offer real-time debugging features. Always use them if they are available. Better to be safe than sorry!
## 7. Not Removing Hardcoded Tracking Codes
If you have decided to migrate from hardcoded Google Analytics 4 (or some other tool) to a more flexible implementation via Google Tag Manager, beware: the process won’t be easy.
This warning does not apply to small websites with basic tracking – just simply add the GTM container snippet to the website, publish the Google tag (or some other tool’s tag) in GTM and remove any hardcoded tracking codes from the website.
But if you’re considering migrating a more extensive website with more complex tracking, many things can go wrong. My Google Tag Manager for beginners course explores topics related to the migration process in greater depth.
The most common issue (from my experience) was not removing some parts of the hardcoded event tracking, which caused data duplication. Some of those hardcoded events were simply missed by the developer, so be vigilant when auditing your migration process.
## 8. Not Doing Audits and Not Having Someone in Charge
Not to be dramatic, but when various people have access to the same Google Tag Manager container, chaos will inevitably ensue. Imagine a contractor from an agency adds some marketing tags, then a colleague from another department adds tags for a new feature, and so on.
Like two ships passing in the night, there may be a lack of coordination among all parties with access to the container; people either don’t know or don’t care about what others are doing in GTM.
The result is a bloated container full of tags that could conflict with one another. Or even better, maybe some of those tags haven’t been used for a year (or years), but they are still in the container (thus affecting the page speed). Remember, every additional tag affects the page speed (the impact might be trivial, but it’s still there).
How do you avoid this situation? I recommend auditing the container at least once every 6-12 months. Collaborate with your colleagues and contractors to review all the tags in the container to confirm if they are still active.
I have seen way too many situations where GTM still contains a tag of a tool that the company hasn’t even used in the last two years. Be sure to remove everything that your business is no longer using.
Or even better, have one person/team in the company who is responsible for Google Tag Manager. If something must be added to the container, that person/team must be informed and provide approval. And if the request is illogical or harmful, it should be rejected.
## 9. Using dataLayer = [], and Putting It After the GTM Snippet
The data layer plays a pivotal role in ensuring a successful implementation of Google Tag Manager, serving as an array containing all the information you want to pass to Google Tag Manager. The data layer object initialized by either the Google tag or Tag Manager is called the dataLayer.
Here are a few examples of what data can pass to the dataLayer:
- User’s pricing plan
- User’s registration country
What can you do with that data? Anything you like!
For example, you can pass the user’s pricing plan as a custom dimension to Google Analytics 4. However, there’s a catch – if developers make this one mistake, your entire GTM event tracking will break.
## 10. Not Monitoring Page Performance After Adding Additional Codes/Tags to GTM
When you started using Google Tag Manager, you probably saw something about how Google Tag Manager supposedly “optimizes page load time”.
The reality is — it depends. I have done a bunch of tests and saw some improvements when comparing hardcoded tracking snippets (added directly to the website) vs. GA4 tags added to GTM.
Nevertheless, every added code piece to a website negatively impacts page loading speed. So, if you add a bunch of different pixels, like Facebook Pixel, GA4, Reddit Pixel, Quora Pixel, or LinkedIn insight tag, your page load time will increase by A LOT.
It’s good practice to check your page speed after you add a new tag. Actually, you should run several tests before adding new tracking and then compare page load times to what happens after you publish your changes.
I have published an article about GTM vs Pagespeed, so take a look there.
领英推荐
## 11. Typos (duh…)
I’ll be quick here. When a tag doesn’t fire, always check for typos in the:
- Trigger conditions: If you’re using regular expressions in your conditions, double-check whether you need standard regex or
case-sensitive regex.
- Variable values: Use the correct name for data layer variables (e.g. correct spelling, including upper and lower case), etc.
- JavaScript code: Check for typos and syntax errors.
If a tag works on one page but not another, check for typos.
## 12. Blocking GTM with AdBlocker
Another common beginner mistake is using an ad blocker in the browser.
Did you know that some ad blockers block not only third-party tracking tools but also Google Tag Manager? They can do this because GTM is not a proprietary tool and can be used by both black hats and white hats (so the ad blockers don’t distinguish the difference between good and evil).
The solution to this problem is straightforward. Disable the ad blocker when you debug the GTM container.
If this problem is unavoidable, here is a solution: test GTM on a separate browser where the ad blocker is disabled. I have also read that some premium GTM implementations are configured so they still work on sites where ad blockers are active. This, however, is still a very gray area for me, so I can’t offer you any guidance here.
## 13. Not Adding All JavaScript Snippets to Google Tag Manager
If you’re managing a more complex website with a lot of custom tracking, you need to be vigilant about adding the correct JavaScript snippets to GTM.
The most common mistakes are:
- Forgetting to add jQuery or other JavaScript libraries: Some websites heavily depend on additional JavaScript libraries. If you use them for tracking or other custom functionality, be sure to add them to GTM, too. In the best-case scenario, the library is hosted by Google. This way, you reduce the negative impact on page speed.
- Missing custom event listeners: If you need to track custom events on your website (e.g., a click on a specific button or an AJAX request), be sure to add event listeners to GTM. This will allow you to trigger tags based on these custom events.
- Using improper JavaScript code: Some JavaScript code might work in the global context but fail in the GTM container. Make sure your JavaScript code is compatible with the GTM environment. If you are unsure, consult a developer.
## 14. Not Using Built-in Variables
Google Tag Manager offers a range of built-in variables that can save you time and effort. These variables are pre-configured and provide valuable information about the current page, events, and other useful data.
Some of the most commonly used built-in variables are:
- {{Page URL}}: The URL of the current page.
- {{Page Path}}: The path of the current page.
- {{Click URL}}: The URL of the clicked link.
- {{Click Text}}: The text of the clicked link.
- {{Event}}: The name of the event that triggered the tag.
Make sure to enable the necessary built-in variables in your GTM container to avoid creating custom variables unnecessarily.
## 15. Not Using Trigger Groups
Trigger groups allow you to combine multiple triggers into a single group. This is useful when you want to fire a tag only when all the triggers in the group are met.
For example, you can create a trigger group that fires a tag only when the user scrolls 50% down the page and clicks on a specific button.
Using trigger groups can help you simplify your GTM setup and reduce the number of tags and triggers in your container.
## 16. Not Using Lookup Tables
Lookup tables are a powerful feature in GTM that allows you to map one value to another. This is useful when you need to transform data before sending it to a tag.
For example, you can use a lookup table to map product IDs to product names before sending the data to Google Analytics 4.
Using lookup tables can help you keep your GTM container organized and reduce the need for custom JavaScript code.
## 17. Not Using Custom Templates
Custom templates allow you to create reusable components in GTM. This is useful when you need to implement the same tracking code on multiple pages or sites.
For example, you can create a custom template for tracking form submissions and reuse it on all your forms.
Using custom templates can help you save time and effort and ensure consistency across your GTM implementations.
## 18. Not Using GA4 Event Parameters
Google Analytics 4 introduces a new event-based tracking model that relies on event parameters to capture additional data about user interactions.
Make sure to use event parameters to send detailed information about events to GA4. This can include custom dimensions, user properties, and other valuable data.
Using event parameters can help you gain deeper insights into user behavior and improve your analytics setup.
## 19. Not Using User-defined Variables
User-defined variables allow you to create custom variables in GTM that can be used in tags, triggers, and other variables.
For example, you can create a user-defined variable that captures the value of a specific query parameter from the URL.
Using user-defined variables can help you capture and use custom data in your GTM setup and improve the flexibility of your implementation.
## 20. Not Using Regular Expressions
Regular expressions (regex) are a powerful tool for pattern matching and text manipulation. They can be used in GTM to create more advanced triggers and conditions.
For example, you can use a regex to create a trigger that fires a tag on all pages that match a specific URL pattern.
Using regular expressions can help you create more sophisticated GTM setups and reduce the need for custom JavaScript code.
## 21. Not Keeping Up with GTM Updates
Google Tag Manager is constantly evolving, with new features and improvements being released regularly. Make sure to keep up with the latest updates and best practices to ensure your GTM implementation remains effective and efficient.
Subscribe to the GTM blog, follow industry experts, and participate in online communities to stay informed about the latest developments in GTM.
By avoiding these common Google Tag Manager mistakes, you can improve the accuracy and reliability of your tracking and analytics setup, gain deeper insights into user behavior, and optimize your marketing efforts. Happy tagging!