Tags Gone Wild! Managing Tag Managers
Tags: seo, webperf, tags
Published: 2020-02-17 17:58:43

---
title: Tags Gone Wild! Managing Tag Managers
published: true
date: 2017-04-19 18:41:00 UTC
tags: seo,webperf,tags
canonical_url: https://nystudio107.com/blog/tags-gone-wild
---

# Tags Gone Wild! Managing Tag Managers

### Tools like Google Tag Man­ag­er and Adobe Tag Man­ag­er offer won­der­ful capa­bil­i­ties, but they can be detri­men­tal to user experience

Andrew Welch / [nystudio107](https://nystudio107.com)

![Buried In Tag Manager Tags](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/_1200x675_crop_center-center_82_line/buried-in-tag-manager-tags.jpg)

Tools like [Google Tag Man­ag­er](https://www.google.com/analytics/tag-manager/) (GTM) and [Adobe Tag Man­ag­er](http://www.adobe.com/marketing-cloud/activation.html) (ATM) are pro­lif­ic in the cor­po­rate world for the mar­ket­ing track­ing capa­bil­i­ties that they offer. But not prop­er­ly curat­ed, they can hurt web­site per­for­mance and user experience.

What these tools do is they allow you to man­age ​“tags” which get inject­ed into a web­page, from a nice friend­ly con­trol pan­el web inter­face. ​“Tags” in this con­text are arbi­trary JavaScript code that does _some­thing_ (usu­al­ly some kind of tracking).

This is empow­er­ing for mar­ket­ing and ana­lyt­ics pro­fes­sion­als, because they can add things like con­ver­sion track­ing, remar­ket­ing, track­ing ​“pix­els”, and so on to a web­page with­out need­ing a pesky devel­op­er to make it happen.

Once the Tag Man­ager’s JavaScript has been put on the page, it takes care of load­ing oth­er JavaScripts (aka ​“tags”) for you.

<aside>
                                Non-devel­op­ers can then inject arbi­trary JavaScript code into every web­page on your site.
                            </aside>

Tag Man­agers emerged ​“as a thing” out of a need for mar­ket­ing and ana­lyt­ics pro­fes­sion­als to do their job with­out need­ing to learn HTML, JavaScript, and so on.

They pro­vide a cen­tral­ized place where all sorts of won­der­ful and hor­ri­ble things can happen.

## What could pos­si­bly go wrong?

As it turns out, a lot can go wrong. Mar­ket­ing-types gen­er­al­ly do not under­stand the impli­ca­tions of the ​“tags” that they are adding to a page — and it’s some­what unfair to expect them to.

I want to reit­er­ate that wher­ev­er you see the word ​“tag” used, it refers to _arbi­trary JavaScript code_ that gets exe­cut­ed in the user’s browser.

<aside>
                                When you include a tag on a page, it can do what­ev­er it wants.
                            </aside>

Tags can — and very often do — load oth­er tags. So you may have includ­ed just 5 tags, but each tag can then end up load­ing as many oth­er tags as it wants. Just like the [1980’s TV com­mer­cial](https://www.youtube.com/watch?v=TgDxWNV4wWY), tags can spread like a social disease.

![They Told Two Friends](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/_576x412_crop_center-center_100_line/they-told-two-friends.png)

So why does this mat­ter? Who cares how many tags are being loaded?

Each tag that gets loaded is anoth­er brows­er request. Grant­ed, they are fair­ly small, but they add up, espe­cial­ly on high-laten­cy mobile connections.

They are also inevitably served up from a vari­ety of places, so there are addi­tion­al DNS lookups that need to hap­pen, and you are also at the mer­cy of the tag’s source web serv­er for their <kbd>expires</kbd> head­er caching policy.

Your web­site that you’ve care­ful­ly tuned as per the [A Pret­ty Web­site Isn’t Enough](https://dev.to/gaijinity/a-pretty-website-isn-8217-t-enough-1nbj-temp-slug-3932740) arti­cle can dete­ri­o­rate into some­thing like this:

![Tag Manager Tags Gone Wild](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/_992x2441_crop_center-center_100_line/tag-manager-tags-gone-wild.png)

So this looks bad, but is it _real­ly_ bad? After all, these tags are loaded asyn­chro­nous­ly, after the web­page has (most­ly) loaded. This is the argu­ment that I’ve heard from some peo­ple (who coin­ci­den­tal­ly are [in the busi­ness](https://twitter.com/nystudio107/status/777988594472542208) of track­ing tags).

Tag sprawl like this is bad because while all of these tags are being loaded, your brows­er is work­ing to pull the requests in.

Ever see a web­page load, but the Google Chrome activ­i­ty indi­ca­tor is still swirling away long after it _looks_ like the page has loaded?

![Google Chrome Activity Indicator](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/_768x244_crop_center-center_100_line/google-chrome-activity-indicator.png)

These are your tags loading.

It’s not just the DNS lookups and net­work band­width for down­load­ing the tags, it’s also the fact that each of these tags is JavaScript that needs to be exe­cut­ed. Have a look at this excerpt of a web­page water­fall show­ing tags loading:

![Tag Javascript Executing](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/_1200x423_crop_center-center_100_line/tag-javascript-executing.png)

All of the pink blocks des­ig­nate CPU usage from tag JavaScript being exe­cut­ed. Imag­ine mul­ti­ply­ing this by each tag that’s loaded on your web­site, and it’s not too hard to see how this can impact performance.

The com­bi­na­tion of DNS lookups, net­work requests, and JavaScript exe­cu­tion — mul­ti­plied by each tag that’s load­ing — are an annoy­ance on desk­top com­put­ers, but they are debil­i­tat­ing on a mobile device.

Mobile devices have restrict­ed CPU pow­er that can be over­whelmed in a hur­ry by all of this activ­i­ty, result­ing in web­pages that are jerky or unus­able until after all of the tags have loaded.

<aside>
                                Not to men­tion that we’re adding to the over­all page weight, and chew­ing up their data plan.
                            </aside>

This is bad. Google thought it was so bad that they cre­at­ed [Google AMP](https://dev.to/gaijinity/google-amp-should-you-care-3din-temp-slug-933989) specif­i­cal­ly to address poor mobile web per­for­mance. Google’s ini­tial tar­get for AMP was news sites, because they are noto­ri­ous­ly bad in terms of adding dig­i­tal detri­tus in the form of tags to webpages.

How bad? Let’s have a look at the well-known news net­work [CNN​.com](http://www.cnn.com/). There are a grand total of <kbd>254</kbd> requests on their home page, the over­whelm­ing major­i­ty of which are tags.

If you’re into gore, have a look at the [full CNN​.com page water­fall](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/cnn_waterfall_tags.png). Hide the women & children.

## So are tags evil?

Tags are not evil; they are actu­al­ly fan­tas­tic in terms of the pow­er that they put into the hands of your mar­ket­ing and ana­lyt­ics folks. 

It’s also impor­tant to note that there’s noth­ing wrong with Tag Man­agers them­selves; they are excel­lent and use­ful tools. It’s a _per­son_ (or mul­ti­ple peo­ple) who ulti­mate­ly are pub­lish­ing these tags, and need to ensure they are doing so responsibly.

At the risk of look­ing sil­ly and quot­ing a com­ic book:

<aside>
                                With great pow­er comes great responsibility.
                            </aside>

I liken tags to pre­scrip­tion drugs; used appro­pri­ate­ly, they can per­form mir­a­cles. If they are abused, how­ev­er, they can be detrimental.

![Tags Are Prescription Drugs](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/_1200x675_crop_center-center_82_line/tags-are-prescription-drugs.jpg)

The great irony here is that tags are most often added to a web­site to track con­ver­sion per­for­mance. But as we talked about in the [A Pret­ty Web­site Isn’t Enough](https://dev.to/gaijinity/a-pretty-website-isn-8217-t-enough-1nbj-temp-slug-3932740) arti­cle, poor web­site per­for­mance neg­a­tive­ly impacts con­ver­sions. In a big way.

This reminds me of the [Observ­er Effect](https://en.wikipedia.org/wiki/Observer_effect_(physics)) from physics:

<aside>
                                In physics, the term observ­er effect refers to changes that the act of obser­va­tion will make on a phe­nom­e­non being observed.
                            </aside>

So by cram­ming all of these tags onto our web­page to mea­sure con­ver­sions, we may be low­er­ing our con­ver­sion rate. Ooops.

## Tam­ing Your Tags

So what can we do about all of this? What we need is a _per­son_ as a Tag Man­ag­er for our Tag Man­ag­er, to whip our tags into shape. A dig­i­tal lion tamer, if you will.

![Taming Tags Whip](https://nystudio107-ems2qegf7x6qiqq.netdna-ssl.com/img/blog/_1200x675_crop_center-center_82_line/taming-tags-whip.jpg)

This per­son should estab­lish a tag pol­i­cy for their orga­ni­za­tion. Here’s what I suggest:

- Every tag should have an own­er, in terms of a per­son who takes respon­si­bil­i­ty for that tag
- Every tag should be doc­u­ment­ed, stat­ing what it does, and jus­ti­fy­ing its existence
- Tags should appear only on the pages where they are actu­al­ly need­ed, not glob­al­ly on every page on the website
- Tags that coin­cide with a mar­ket­ing cam­paign should be set up to expire at an appro­pri­ate date
- Tags should be audit­ed on a reg­u­lar basis, and pruned back regularly

I’ve worked with more than one orga­ni­za­tion where they did­n’t even know what all of their tags were doing. In cas­es like this, I’ve found the [Tag Inspec­tor](https://taginspector.com/) ser­vice to be a good first step at get­ting a han­dle on your tag sprawl.

It’s also eye-open­ing to audit your web­page’s load­ing water­fall via [Web​PageTest​.org](https://www.webpagetest.org/) to see what is actu­al­ly load­ing when some­one vis­its your website.

<aside>
                                And make sure your tags are actu­al­ly accom­plish­ing your goals!
                            </aside>

In addi­tion, pay atten­tion to the logis­ti­cal side of things:

- You don’t need 5 dif­fer­ent tags track­ing the same thing.
- If your tags are intend­ed to track con­ver­sions, make sure that they aren’t inhibit­ing con­ver­sions themselves!
- Be sure that there aren’t bet­ter ways to track what you’re try­ing to track, such as serv­er-side track­ing via the [Google Ana­lyt­ics Mea­sure­ment Protocol](https://developers.google.com/analytics/devguides/collection/protocol/v1/)
- If you’re using the Tag Man­ag­er to imple­ment A/B test­ing, be sure [you’re doing it right](https://unbounce.com/a-b-testing/simple-ab-testing-mistake-thats-killing-conversion-rates/)
- If your A/B test­ing is neg­a­tive­ly affect­ing your web­site per­for­mance or UX, your A/B test results may be suspect

In a nut­shell, tag respon­si­bly. And under­stand that there is a cost asso­ci­at­ed with the track­ing that you’re doing.

Devel­op­ers need to make the mar­ket­ing & ana­lyt­ics folks aware of the cost of tags, and mar­ket­ing & ana­lyt­ics folks need to make devel­op­ers aware of what they are try­ing to accomplish.

This con­ver­sa­tion is what is going to help you make some­thing tru­ly fantastic.

Hap­py tagging!

## Further Reading

_If you want to be notified about new articles, follow [nystudio107](https://twitter.com/nystudio107) on Twitter._

<small>Copyright ©2020 nystudio107. Designed by nystudio107</small>