Google Tag Manager and tracking pixels: adding them without slowing your site

The short answer: Google Tag Manager is a dashboard where you keep, in one place, the tracking codes of your site (statistics, ad pixels, chat buttons). You put a single line on the site and from then on add and remove codes in the dashboard, without touching the site. It is convenient, but every code you put there is one more request the visitor has to load.

How to get it working

1 Create an account and a “container” on the Tag Manager site. It gives you an identifier like GTM-XXXXXXX.
2 Paste the two code snippets it shows: one inside <head> and another right after <body>. On WordPress, use a plugin to insert code in the header instead of editing the theme: a theme update would erase the edit.
3 Create the “tags” in the dashboard, for instance the statistics one. See Google Analytics: setting it up and what to look at first.
4 Use preview mode before publishing. It shows on your site which tags fire and when.
5 Publish the version and open the site in a private window to confirm.

To keep the site from getting slow

Habit Why
Remove the tags nobody uses any more. Each one is a request to another server. They pile up over time, and nobody remembers who added them.
Fire each tag only where it is needed. A purchase pixel only has to run on the confirmation page, not on all of them.
Measure before and after. It is the only way to know what it cost. See Measuring your site speed.
Avoid several tools that do the same thing. Two statistics tools at once is paying twice in speed.
Consent. Many tags store visitor data or use cookies. On a site with visitors from Europe, among other countries, they usually need consent before firing, and Tag Manager has ways of making them wait for it. See The cookie notice and consent. Rules vary by country: check what applies to you.
Control who has access to the dashboard. Whoever can edit the container can put code on your site that runs on every page. Give access only to those who need it, and remove it when the person leaves. See also Giving a developer access without handing over your password.
Only need simple statistics? You may not need a tag manager: see Website statistics without Google.

Did the site get slow after adding tags? Open a ticket with the address and the list of tags you have.

Open a support ticket

SEE ALSO

Google Analytics: setting it up and what to look at first

The cookie notice and consent: what your site collects without you knowing

Measuring your site speed: which tools, and what the numbers mean

Personal data protection: what applies to your website

RECOMMENDED PRODUCT

Web hosting with cPanel

Domain and SSL included, daily backups and the panel you already know. from $6.59/mo (3-year plan, with coupon)

See plans
  • 0 Users Found This Useful
Was this answer helpful?