by Kai

06/10/2016

Google Analytics, Google Tag Manager, Implementation of Google Analytics

GTM Container Placement has massive business impact

Ever wondered what the impact of the GTM container script placement has on your GA data accuracy? Google’s official recommendation is to place the container script as close to the opening <head> tag as possible across all pages. The official documentation can be found here: https://developers.google.com/tag-manager/quickstart

We have tested the impact on data quality on a content rich e-commerce site for a month. For this purpose we used two identical GTM containers. We placed one container in the <head> section, and the other in the <footer> section, sending the data to two identical GA properties.

Headline metrics

Without further ado, here are the headline metrics:

As you might have guessed, the GTM container in the footer is under reporting for all of the above metrics, except for session duration and the bounce rate. What stands out is the bigger discrepancy when it comes down to transactions and revenue. We have to keep in mind that these metrics are across all device categories. How does this look if we break it down by desktop, tablet and mobile?

Device breakdown is key

Let’s take a look at desktop first, which for this site is still the main driver of traffic.

As expected, the data looks in-line with what we saw across all device categories, transactions, session duration, users and page views are impacted the most.

For tablet devices we see a slight increase in discrepancies compared to those reported from desktop devices. Interestingly we see a higher session duration and more pages / session for tablet.

Take a look at the differences in metrics for mobile devices. As we know, mobile devices aren’t always connected to WiFi and therefore are more likely to be exposed to greater network latency. This results in an even bigger time delay till the GTM container gets loaded, especially if it has been placed in the <footer> section.

At first glance, the discrepancies in most metrics are lower than expected. That is until you take a look at the difference in transactions and revenue – 13% difference!

Conclusion

Mobile first

While this site’s audience is dominated by desktop users, we have seen other sites where mobile is now the main driver of traffic – mobile first. Knowing that these devices can have slower load times due to network availability, it is even more important to get the GTM to load as soon as possible.

GTM container placement matters

As the container snippet loads asynchronously, there are only weak technical arguments against placing it as close to the opening <head> tag as possible. Place the <noscript> part immediately after the opening <body> tag. This will allow you to use GTM to verify your site with the Google Search Console product. If you aren’t concerned about that, and you know that your site can’t be used without JavaScript anyway, then you may as well just ditch it altogether.

Not placing the GTM container in the documented place has a significant impact on your data.

Comments

Leave a comment

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