WritingHow to Implement Server-Side Tracking with Google Tag Manager — Clixo
5 min readserver-side-tracking, gtm, ga4, marketing-analytics

How to Implement Server-Side Tracking with Google Tag Manager

Step-by-step guide to setting up server-side tracking with GTM. Recover lost conversion data, bypass ad blockers, and improve GA4 accuracy.

If your conversion data looks lower than it should, the culprit is usually not your funnel — it is your tracking setup. Browser-based (client-side) analytics loses a meaningful share of events to ad blockers, Safari's Intelligent Tracking Prevention, and cookie restrictions. By the time a user converts, the event sometimes never fires.

Server-side tracking moves the data collection layer off the user's browser and onto a server you control. The result is more complete data, better privacy compliance, and a measurement foundation you can actually trust.

What Server-Side Tracking Actually Does

In a standard client-side setup, a JavaScript tag on your site sends data directly from the user's browser to Google Analytics, Meta, or any other platform. Every browser extension, privacy setting, or network restriction can interrupt that request.

With server-side tracking, your site sends a single event to your own server container. That container then forwards the event to every downstream platform — GA4, Meta CAPI, Google Ads — from a server environment where ad blockers have no reach.

The core infrastructure is a GTM server container hosted on a subdomain of your own domain, such as analytics.yourdomain.com. Because the request originates from a first-party subdomain, cookies set by the server are treated as first-party cookies by browsers, giving them a longer effective lifespan.

How to Implement Server-Side Tracking with GTM

Step 1: Create a GTM Server Container

In Google Tag Manager, create a new container and select Server as the container type. This generates a separate container from your web container — they work together but are configured independently.

You will receive a container snippet and a server URL that you will point to your hosting environment.

Step 2: Deploy the Server Container to a Cloud Host

GTM server containers need to run on a server. Google Cloud Run is the most common choice because Google pre-configures the deployment, but you can use any cloud provider that supports containers.

Deploy the container and configure it to run on a subdomain of your site:

  • Set up a CNAME DNS record pointing analytics.yourdomain.com to your cloud host
  • Configure SSL for the subdomain
  • Verify the server URL in GTM points to your subdomain

Step 3: Update Your Web Container to Forward Events

Your existing web container tags need to be updated to send events to your server container instead of directly to GA4 or ad platforms.

Replace your standard GA4 Configuration tag with a GA4 tag that points to your server container URL. The web container sends a measurement protocol hit to your server, and the server container handles the forwarding.

Key configuration:

  • Set the transport URL in your GA4 web tag to your server container URL
  • Pass client_id and session_id as event parameters so the server container can reconstruct session context

Step 4: Configure Server-Side Tags

In the server container, create tags for each downstream destination:

  • GA4 tag pointing to your GA4 Measurement ID
  • Meta Conversions API tag for sending server events to Meta
  • Google Ads conversion tag if you are tracking paid conversions

Each tag in the server container reads from the incoming event data and reformats it for the target platform.

Server-side tracking still requires consent compliance. Before sending events server-side, check that the user has consented. Use GTM's consent mode variables, or pass a consent flag as a custom parameter from your web container.

Do not send server-side events for users who have opted out — the server container does not enforce this automatically.

Step 6: Test Before Going Live

Use GTM's preview mode for both your web and server containers simultaneously. Check:

  • Events appear in the server container preview
  • The server container is forwarding to GA4 (visible in GA4 DebugView)
  • Session attribution matches what your web container previously recorded
  • No duplicate events are being sent (this is a common misconfiguration)

What to Watch Out For

Double-counting. If you migrate to server-side but leave your old web tags sending directly to GA4, you will count every event twice. Disable or remove the client-side GA4 tags once the server-side path is confirmed working.

Clock skew on events. GA4 rejects events with timestamps that are too far in the past. If your server container queues events, make sure they are forwarded promptly.

Cost of the server. A server container handling significant traffic needs appropriate compute resources. Cloud Run's autoscaling handles spikes well, but budget for it — it is not free at scale.

The Payoff

Teams that migrate to server-side tracking commonly recover a significant portion of previously lost event data. More complete conversion data means more accurate bidding signals for paid campaigns, cleaner attribution, and reports you can defend in a budget review.

If you want a production-grade server-side tracking setup built and documented for your stack, get in touch with Clixo. We handle the infrastructure, the tag configuration, and the QA — so your team gets clean data without the setup burden.