Tracking and data

Web tracking and Google Tag Manager

Correct web tracking is the difference between marketing that works and money that disappears. Google Tag Manager is the hub, but only if it is set up right.

With GTM you can

  • Install GA4
  • Meta Pixel
  • LinkedIn
  • TikTok
  • Consent Mode v2

Common mistakes

  • No consent
  • Duplicate data
  • Broken triggers
  • No dataLayer

The foundation

  • dataLayer
  • Tags
  • Triggers
  • Variables

What is web tracking?

Web tracking means measuring what visitors do on your site: which pages they visit, which buttons they click, where they leave and, above all, whether they make a purchase or another conversion. Without correct tracking you make marketing decisions blind.

In Sweden, web tracking is regulated by the GDPR and the ePrivacy directive. That means tracking requires active consent from the visitor, and trackers must not be activated before consent is given.

Google Tag Manager, the hub for all tracking

Google Tag Manager (GTM) is a free tag management system that lets you install and manage all your tracking codes from a single interface, without touching the source code of the site. It is the standard tool for any serious web tracking setup.

With GTM you can:

  • Install GA4, Meta Pixel, LinkedIn, TikTok and hundreds of other tags
  • Set up triggers that fire tags at the right moment
  • Build a structured dataLayer that holds all the data together
  • Connect Consent Mode v2 with your CMP
  • Test and debug in real time without affecting production

Why most GTM setups go wrong

GTM is powerful, which is exactly why it is easy to get wrong. The most common problems are:

  • Tags firing without consent, a GDPR violation that can lead to fines
  • Missing Consent Mode v2 integration, so Google Ads loses conversion data
  • Duplicate data collection, so GA4 counts page views twice
  • Broken triggers, so conversions are not registered
  • An unstructured dataLayer, impossible to scale and maintain

A correct GTM implementation, step by step

A professional web tracking setup starts with a well-structured dataLayer. It is a JavaScript object that lives on the site and collects all information that is relevant to send to analytics tools, such as product names, prices, user type, form steps and much more.

On top of the dataLayer, tags, triggers and variables are set up in GTM. Each tag sends the right data to the right platform at the right moment, and only after the visitor has given consent.

What does incorrect web tracking cost?

Incorrect tracking costs you in two ways. First, you risk GDPR fines if tracking happens without consent. IMY has fined Swedish companies hundreds of thousands of kronor. Second, your ads optimize on the wrong data, which raises CPA and lowers ROAS.

Combined, you can end up paying twice: once in fines and once in inefficient advertising.

Frequently asked questions

Do I need Google Tag Manager for web tracking?

GTM is the standard tool for managing tracking codes from one interface without touching the source code of the site, so it is the usual choice for any serious setup.

Does web tracking need consent?

Yes. In Sweden tracking is regulated by the GDPR and the ePrivacy directive, which require active consent, and trackers must not be activated before consent is given.

What is a dataLayer?

A JavaScript object that lives on the site and collects the information you want to send to analytics tools, such as product names, prices, user type and form steps.

Want to talk it through?

Tell me what you are working on and I will get back to you with straight answers.

Let's talk