URL contains more than one Google Tag Manager code

This means that the URL in question contains more than one Google Tag Manager snippet.

Why is this important?

Google Tag Manager (GTM) is user-friendly solution to managing tracking and analytics tags, for example Adwords Conversion Tracking and Google Analytics.

This Hint highlights that more than one GTM snippet was found.

Whilst this is supported by Google, it is not recommended - so this Hint exists to highlight the issue for further investigation.

What does the Hint check?

This Hint will trigger for any internal URL that contains more than one GTM code within scripts on the page.

Examples that trigger this Hint

The Hint would trigger for any URL which contains a script in the <head> that contains a GTM code (e.g. GTM-XXXX);

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->

and contains at least one more script in the <head> that contains a GTM code (e.g. GTM-YYYY);

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-YYYY');</script>
<!-- End Google Tag Manager -->

Why is this Hint marked 'Advisory'?

It is entirely possible that you might run into a situation where multiple Google Tag Manager containers are required on the same page. Whilst it is valid, Google advise to keep the number of Google Tag Manager containers on the page minimal, for best performance.

Further Reading

Ready to try Sitebulb?
Start your free 14 day trial now

Start Free Trial