Data & Analytics Strategy
Understanding Google Analytics and the Google Tag
By Alex Krumins

Noticing some pesky issues with gtag.js on your website? We share what’s happening, why, and how to fix it.

Multiple gtag.js Libraries are loading on my site. What do I do?

Do you use Google products on your website? If so, have you ever noticed that multiple instances of gtag.js load on your site? Perhaps you’re testing site performance or running audits, and you’re concerned that unnecessary code is affecting page-load time. Maybe during your evaluation you’ve noticed not one, but two or more instances of gtag.js load on your site. If so, we can explain why.

Why does gtag.js load more than once?

This situation can be puzzling for anyone unfamiliar with Google products, but the explanation is simple. The most common reason why multiple instances load is due to different Google containers. But don’t panic, this is a routine occurrence, especially for websites integrated with multiple tracking codes or analytics tools.

What is a Google container?

If you ask Google, ‘Containers are lightweight packages of software containing all necessary elements to run in any environment’.  Each container has its own unique ID and corresponds to a specific Google product and account. This software is used to track and analyze web data. When multiple Google containers are used on a single webpage, each container requires its own instance of gtag.js to function.

Why does the site have multiple containers?

There are a few reasons why multiple containers may be present. First off, each Google product has different features. For example, if you’re using Doubleclick for site traffic and AdWords for tracking conversions, each will need their own gtag.js script.  Alternatively, depending on the size of the business, there may be independent teams that need their own unique tracking implementation. At the end of the day, each site is different and depending on the use case multiple containers may be required.

Is more than one gtag.js script really necessary?

Multiple instances of gtag.js may seem unnecessary, but each account’s instance of gtag.js is actually unique. This allows sites using multiple Google products to maintain separate tracking and downstream analysis. As long as each instance of gtag.js has its own distinct ID, everything is working as expected.

So, everything is fine?

In conclusion, the presence of multiple containers is nothing to be alarmed about. It simply means multiple Google products are used simultaneously. So, next time you see multiple instances of gtag.js loading, you can rest assured that it is all part of the process to monitor and analyze site performance.

Running into other issues with your Google Analytics setup? Our team of analytics experts is here to help. Find out more about our analytics services or reach out to talk to a real human.

Sign up to receive our bimonthly newsletter!

Not sure on your next step? We'd love to hear about your business challenges. No pitch. No strings attached.

©2024 Concord. All Rights Reserved