Limited-time sale on all Analytics Mania's courses!

Learn more
  • Courses
    • 🔥 SALE 🔥
    • Courses
    • Course bundles
  • Blog
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • Services
  • About
    • About
    • Contact
  • Login
  • Courses
    • 🔥 SALE 🔥
    • Courses
    • Course bundles
  • Blog
  • Resources
    • Youtube channel
    • E-books and Guides
    • GTM Recipes
    • View All Resources
    • GTM Community
    • GA4 community
  • Services
  • About
    • About
    • Contact
  • Login

January 7, 2022

Google Tag Manager Firing Twice? Here’s a solution

Here’s a situation. You are using a Google Tag Assistant (legacy) Chrome extension and you get a “Multiple installations of Google Tag Manager” warning.

You ask your developer to make sure that Google Tag Manager is really installed once and he/she confirms that. So why is Tag Assistant saying that Google Tag Manager is firing twice? In this quick blog post, I will explain that.

There are two possible reasons for this. Well, actually, three. But the first two are “false positives”.

 

Reason #1. You are working with a single page application

If you’re seeing that warning in Tag Assistant and the IDs of both containers are actually the same, I have a hunch that you’re working on a Single Page Application.

If yes, then most likely, there is nothing to worry about (but just to double-check, continue reading).

Unfortunately, Tag Assistant does not play well with Single Page Applications. Even though only one GTM container is installed, Tag Assistant may display multiple container instances as the app loads or a visitor continues to browse. This does not happen on ALL single-page applications but is quite often nonetheless.

 

Solution for Reason #1

What should you do about it? Most likely, ignore the warning. But you can double-check if this is the real reason.

To verify whether you actually have multiple installations of Google Tag Manager, check network requests in browser’s developer tools. In this demo (and as always), I’ll be using Google Chrome.

In the top right corner, click 3 dots, then go to More tools > Developer Tools.

Switch to Network tab and in the search field enter “gtm.js” (without quotation marks), keep All selected, and refresh the page.

After the page has reloaded, take a look at how many gtm.js do you see?

If one, you’re good to go. Just ignore Tag Assistant’s warning about multiple installations.

Seeing two requests? Continue reading.

 

Reason #2. You have enabled preview mode of Google Tag Manager

If you still see Google Tag Manager firing twice, another reason might be GTM’s preview mode.

When Preview and debug mode is enabled, it sends two requests to Google Tag Manager:

  • one to load gtm.js
  • and another one to load gtm.js (but the URL contains more parameters, like gtm_debug=x).

If that is your case, don’t worry. This is expected. Once you disable the preview and debug mode, you will once again start seeing a single request to gtm.js.

Also, this 2nd request does not interfere with your testing, you will not be getting duplicate page views or something like that. Thus, ignore this.

 

None of the tips worked?

If none of these tips worked and you still continue seeing two or more requests to gtm.js in your browser’s developer tools, then I think you indeed have multiple containers (or a single container installed multiple times).

Have a discussion about that with someone who might know the project/website you’re currently working on. Even though it isn’t optimal to use multiple GTM containers, it is possible. You can learn more about this here.

If nobody intended to have multiple containers on the same site, just remove the one that shouldn’t be there (or ask someone to do that).

Julius Fedorovicius
In Google Tag Manager Tips
3 COMMENTS
georgiana
  • Apr 12 2022
  • Reply

How can I debug the reason why I have multiple gtm.js pushes in all site pages in debug mode? I cannot find any relevant info anywhere

    Julius Fedorovicius
    • Apr 12 2022
    • Reply

    I explained that in tip #2

    In other words, don't worry. This is normal. There is nothing you should do about it.

Jay Kewl
  • Jun 23 2023
  • Reply

Hi Julius, I can see when I use debug mode that I have two instances of GTM firing. When I then look at the summary window in tag manager I see the actions appear twice.

So for Example, it looks like this:

Receipt Page:
Window Loaded
Container Loaded
Dom Ready
Cookie Consent Update

then below that it is repeated again:

Receipt Page:
Window Loaded
Container Loaded
Dom Ready
Cookie Consent Update

Is this because the main GTM container is loading and then also the 2nd preview mode container so sending the events twice? If so, how do I know which one is for which container tag or instance of it as they both look exactly the same.

Any thoughts or help would be greatly appreciated.

Leave a comment Cancel reply

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


 

Hi, I'm Julius Fedorovicius and I'm here to help you learn Google Tag Manager and Google Analytics. Join thousands of other digital marketers and digital analysts in this exciting journey. Read more
Analytics Mania
  • Google Tag Manager Courses
  • Google Tag Manager Recipes
  • Google Tag Manager Resources
  • Google Tag Manager Community
  • Login to courses
Follow Analytics Mania
  • Subscribe to newsletter
Recent Posts
  • Top 22 Benefits of Google Analytics 4
  • Track HubSpot Forms with Google Tag Manager and Google Analytics 4
  • dataLayer.push not working? Here are some reasons and solutions
Analytics Mania - Google Tag Manager and Google Analytics Blog | Privacy Policy
Manage Cookie Settings