How Tag Managers impact web performance

Spread the love

Using a Tag Management System – like Google Tag Manager or TagCommander – to deal with scripts and third-party content populating your web pages presents obvious advantages for marketers. From a Web Performance point of view, the impact of such tools deserves your attention…

Let’s talk about tags. Those code snippets usually relying on external resources, most of the time implemented via JavaScript code, tend to proliferate in your websites. That’s not a surprise indeed: if you work on web marketing, these tags – theoretically – represent a quick and easy way to add new features to your web pages… Whether these features benefit your visitors or are useful for your own business. Here are some of the most common examples: analytics tracking tools, social widgets, ad serving, retargeting or A/B testing scripts, etc.

3rd party content distribution

Discussing about third-party content, Paul Calvano published this graph, which illustrates quite well the importance of these external resources for a significant number of websites.  

External scripts, on-page consequences

Unfortunately, using these tags also has its drawbacks:

At the business level first: each tag to be added requires to involve the development team, which has to schedule it, plan to deliver on an integration environment… Before you can even launch your tests (and eventually, give it up!). A laborious process, implying some developments and releases whereas the use, configuration and tag evaluation stage is only one step in the selection process, and can lead you to abandon the script. Investing development teams this way can lead to frustration, delays and hassle.

Beyond the risk that these scripts represent for your web page, since they can modify its content, your website performance can also be affected. For example, some of these tags can be executed synchronously. As a consequence, depending on their placement in the page, they may block the loading of other elements and significantly affect the user experience. Of course, this type of impact is not inevitable: there are methods to load JavaScripts more efficiently, as explained in this post: “Defer scripts to speed up rendering”.

One tag to manage (almost) them all

Tag Managers (aka TMS for tag Management Systems) are a technical solution to facilitate your workflow. Here is the very first argument to be featured on the Google Tag Manager website: “Marketers want tag management that’s simple, reliable, and integrates easily with existing systems. […] You’ll launch programs faster, so you can make swifter decisions”. Since the free service developed by Google owns more than 50% market share – according to Datanyze and Built With statistics – we will then focus on this tool for the rest of this post (assuming that alternative services offer quite similar features).

For marketers, a Tag Manager service offers an interface allowing to manage (add, configure, deploy, etc.) all or part of the external scripts on your website, without systematically committing developers (once the initial Tag Manager script is in place, of course). Among the main advantages of the service highlighted by GTM, we can notice:

  • More autonomy for marketing departments to quickly add or modify tags, while having access to a preview mode, version history, etc.
  • Reliability and control, as the solution includes tools to manage your own workflow (multi-users features with different authorization levels) and verify that everything is working properly within your infrastructure
  • Flexibility. Google Tag Manager highlights its compatibility “with many Google tags and various third-party tags” (which you can find a list here).

Technically, the Tag Manager consists of a single <script> element (in two parts as shown in the illustration below) that acts as a container for other external resources and takes care of loading them as efficiently as possible (at least according to the rules you have defined). Bringing one first benefit: low implementation cost for developers, fast deployment and no iteration.

GTM container tag

Source : https://www.optimizesmart.com/beginners-guide-google-tag-manager-v2/

However, does the Tag Manager have to – or can – manage all the tags in your web pages? “When you upgrade your site or app to Tag Manager, the best practice is to migrate all your tags at once. However, this is not a mandatory requirement,” says GTM. For an obvious reason: not all the tags can be deployed via Google Tag Manager. Himanshu Sharma (OptimizeSmart.com) indicates a couple of exceptions:

  • Synchronous tags
  • Tags divided in several parts that need to be executed in a certain order
  • Tags which are just not supported by GTM “For example, ‘Facebook JavaScript SDK’ tag can not be deployed via GTM,” explains the web analyst

In fact, you probably won’t be able to manage all your existing tags via a tag manager. Nevertheless, GTM seems to integrate the largest range of them: besides its own system of templates for Google tags but also for a growing list of approved providers, the service allows to deploy any type of custom tag (i.e. created by yourself). With a warning though: “The best way to avoid performance and malware issues is to use the tag templates built into Google Tag Manager“…

About the impact on web performance

There we come to the Web performance issue: What kind of impact can a tag management system have on your web page speed? This not such a trivial question, since we have previously reminded that third-party content bring serious consequences on web performance (you can also read this dedicated post for further information).

Theoretically, we can assume a negative impact: after all, using a tag manager essentially means adding an extra tag to your web page, i.e. one more dependency, an additional DNS resolution and a TCP connection (tip: you can prevent this by preconnecting to the third party’s origin)!

Instead, most of TMS solutions claim a positive effect on web performance of the pages on which they are implemented. According to the results of a survey conducted by Econsultancy among a sample of North American web marketers, 64% of TMS users noted an increase in site speed associated with replacing multiple tags on their site with the single tag of a managed solution. A third (34%) describe the increase as “significant.”

Beware though: this promise of better performance should rather be seen as the result of the application of new good practices and constraints. Let’s quickly examine the reasons for this potential improvement:

Tag managers like GTM trigger tags asynchronously. This means that the scripts load independently of each other and parallel to the other elements of the page, without blocking their loading. Then, the impact on web performance is much more limited than with synchronous tags. If the adoption of a TMS allows you to pass some tags from synchronous to asynchronous loading, you will see the benefits. If, on the other hand, you are using tags that require a blocking behavior, then a tag manager is not a solution for you.

Google Tag Manager strongly recommends to set up – in collaboration with developers – a “data layer” to collect and store data needed by third-party scripts. Besides the obvious interest of this practice to get a better control of your data (and also serve for debugging), this consolidation also avoids retrieving one same data several times for several tags. More broadly, the implementation of the Data Layer is also an opportunity to rethink about the data to be transmitted to third party scripts… And perhaps to do a salutary cleaning before the arrival of RGPD!

Generally speaking, tag managers try to minimize their impact on web performance, as Georgene Nunn explains it on conversionxl.com: “It’s also common for a tag manager to use a Content Delivery Network (CDN), meaning that you don’t have to rely on a single server to respond to get tags to work correctly“.

Tag managers, therefore, do not guarantee any results about web performance optimization regarding tags. Furthermore, if the adoption of such a solution may generate short-term benefits, its use over time also constitutes a risk for your website speed… Be careful, indeed, not to get blinded by the autonomy brought by this tool, by-passing the integration step by the technical teams. Your tag manager may then become the tip of the iceberg with tons of scripts accumulating over time!

As Web Analyst Franck Scandolera explains, TMS can cause serious issues if they are not rigorously managed: “Without discipline you run the risk of accumulating long and unmanageable lists of tags, rules and macros, uselessly overloading your GTM container. Worse yet: you could bring your website down, causing a significant financial loss to your business”.

Moreover, the use of a TMS should not exempt you from addressing the third-party resources issue from a performance budget perspective. Because this approach will really allow you to optimize your website speed. For each tag or feature, weigh its benefits against its web performance impact, and then arbitrate!

Shortlisting the best practices regarding the implementation and use of a tag manager, focusing on some crucial points concerning web performance impacts, cohabitation with approaches such as CSP (Content Security Policy), and some specialist advice as a bonus: we are currently preparing a second part to this post dedicated to tag managers, to be published soon. Stay tuned!

Edit – This second post is now available there:
Tag managers & Web performance: a question of discipline and collaboration


Spread the love