Server-side tracking: better measurement with server-side GTM

Server-side tracking: better measurement with server-side GTM

Server-side tracking means measurement data is sent from the browser to a server you control, and from there to Google Analytics, Google Ads, Meta and other platforms. In classic client-side tracking the browser loads a script from each vendor. With server-side tracking there is one connection from the browser, to your own subdomain such as data.yourdomain.com.

The most common solution is server-side Google Tag Manager (sGTM). The result is usually more complete data, a faster site and more control over what is shared.

Client-side vs server-side

Client-sideServer-side
Where tags runIn the browserOn your server
Third-party scriptsOne per vendorOne or none
Ad blockersOften blockedLess affected
CookiesOften capped at 7 days in SafariCan be set as first-party cookies by the server
Data controlVendors get what the browser sendsYou filter and enrich before forwarding
CostFreeHosting and setup

Benefits

  • More data, as fewer events are lost.
  • Better signals for ad platforms via Meta Conversions API, enhanced conversions, Microsoft UET and TikTok Events API.
  • Faster pages with fewer scripts.
  • Privacy control: strip IP addresses, personal data and URL parameters before data leaves your server.

What it does not do

Server-side tracking is not a way around consent. GDPR and ePrivacy rules apply wherever the tag runs. See Consent Mode v2.

Setup

  1. Create a server container in Google Tag Manager.
  2. Choose hosting: Google Cloud Run or a managed provider such as Stape, Taggrs or Addingwell.
  3. Map a first-party subdomain via DNS.
  4. Point the Google tag to your server container URL.
  5. Configure clients and tags: GA4, Google Ads, Meta Conversions API and so on.
  6. Pass consent state and test in both web and server preview.
  7. Remove client-side tags now covered by the server, and deduplicate Meta events with event_id.

When is it worth it?

  • You spend significant budgets on Meta, Google Ads or TikTok.
  • You run ecommerce with many Safari and iPhone users.
  • You want fewer third-party scripts for speed and privacy.

Frequently asked questions

What is server-side tracking?

Tracking where data is sent from the browser to a server you control, such as server-side GTM, and then forwarded to analytics and ad platforms.

Is server-side tracking allowed without consent?

No. Consent rules apply wherever tags run.

How much does server-side GTM cost?

The tool is free, but hosting is not. Managed providers start at a modest monthly fee for small sites.

Read also

Sources

  1. Google Tag Manager, Introduction to server-side tagging: developers.google.com/tag-platform/tag-manager/server-side/intro
  2. Meta for Developers, Conversions API: developers.facebook.com/docs/marketing-api/conversions-api/
  3. WebKit, Tracking Prevention in WebKit: webkit.org/tracking-prevention/

More about Marius Vestlien Hansen →

Read next

More articles

All articles
Next step

Get in touch for a coffee and a chat about how I can strengthen your business

Book a coffee chat