GTM template with instructions video from Simo Ahava!

GTM template with instructions video from Simo Ahava!

Server Side Tracking

How to Set Up Server-Side Tracking: A Step-by-Step Guide

Learn how to set up server-side tracking with sGTM or a managed platform. Compare setup time, cost, and maintenance to find the right path for your team.

Anni Salo
15/10/2025 12:00 AM

Follow this step-by-step guide to set up server-side tracking. See how to implement it efficiently with both sGTM and Tracklution so you can decide what path is right for you. 

  1. What you need before you start
  2. Choose your implementation approach
  3. Set up your tracking infrastructure
  4. Configure data collection and event mapping
  5. Connect your ad and analytics platforms
  6. Validate, prevent duplicates, and go live
  7. Troubleshooting common issues
  8. Frequently asked questions

For many performance marketers, server-side tracking feels overwhelmingly complex. While some implementation paths are highly complicated and challenging, there’s a big difference between going with a fully custom-built setup and working with a managed provider. 

The right implementation path depends on your team’s technical resources, customization needs, timeline, and how much ongoing maintenance you’re willing to take on. In this guide, we'll cover how to choose the right approach for your business, set up the server-side infrastructure, map events, connect your ad platforms, and validate everything before rollout.

What you need before you start

Before setting anything up, make sure you have:

  • A website with conversion tracking already implemented (even a basic pixel setup gives you something to build on)
  • Admin access to your advertising platforms (Google Ads, Meta, TikTok, or whichever you're running)
  • A basic understanding of your current tracking setup, including which events you're already capturing and where the gaps are

Right now, your ad platforms are missing conversion data. According to GWI data, 29.5% of internet users worldwide use ad blockers at least sometimes, and that's before browser restrictions and consent opt-outs strip out even more.  

Server-side tracking routes that data through a server you control (instead of sending it straight from the browser to each platform), then forwards clean data via secure APIs. 

For the full picture on why server-side tracking matters, see our server-side tracking guide.

How to choose your server-side tracking implementation approach

There are three main ways to implement server-side tracking, from full control with high complexity to a plug-and-play setup.

DIY custom infrastructure

A fully DIY setup involves provisioning your own server, writing your own API integrations, and maintaining everything yourself. This gives you total flexibility, but it's a serious engineering project. 

Anni Salo, CEO at Tracklution, explains, “Very rarely do we talk with people who want to go full do-it-yourself. When they do, it's usually a one-year technical project.” 

Unless you have a dedicated engineering team and a specific reason off-the-shelf tools won't work, this path rarely makes sense, so we won't walk through it step by step in this guide. 

Server-side Google Tag Manager (sGTM)

Google's free server-side container is the option most teams choose first. You provision a server container, either self-hosted on Google Cloud or through a hosting provider like Stape or TAGGRS, and configure it yourself. You get to create a truly bespoke setup and stay in full control of privacy and security, but that comes with continual upkeep. 

As Lucas Nilsson, Product Specialist at Tracklution puts it, “It requires a lot more than you expect from the beginning. You need to manage deduplication, block unwanted traffic, connect offline events with browser events, and connect conversions with attribution data.” You’ll also need somewhere to store that data, which requires configuring a database yourself.  

It helps if you’re already familiar with GTM, its templates, and which tracking technique fits which situation. If not, you’ll need to learn the UI, and the difference between variables, triggers, and tags. Then you’ll need to understand the server-side layer: generating a consistent event ID and matching it between your pixel and CAPI payload so the same conversion doesn't get counted twice.

Hosting costs typically start around $20/month on lower-volume tiers and scale with your event volume. On top of that, set-up costs can spiral upwards of €10,000. Depending on complexity, this approach typically calls for dedicated engineering resources for 3+ months of development, plus ongoing maintenance. 

Choose sGTM if:

  • You have in-house engineering capacity to own it long-term
  • You want maximum control, including custom enrichment logic
  • You can commit to ongoing maintenance as platform APIs change

If you're researching different approaches, our guide to the best server-side tracking tools compares the top solutions in detail. 

Managed platform 

With a managed platform like Tracklution, everything is pre-configured and maintained for you. You just set it up; we take care of the server, the API connections, and the ongoing maintenance. Deduplication, database configuration, and per-platform formatting are off your plate. You stay in control of what gets tracked and where it goes, but you're not the one keeping the infrastructure running. 

You also get full data visibility through a dashboard showing you exactly what came in, what went out, and how each platform responded. 

Cost runs as a single subscription instead of hosting fees plus engineering time. Maintenance, including API updates and platform changes, sits with the provider rather than your team. Setting up Tracklution usually takes 16 minutes, and if your team uses AI coding agents like Cursor or Claude Code, it can be installed via a single prompt through Tracklution's managed MCP server.

Choose a managed platform if:

  • You'd rather your team spend time on campaigns than container upkeep
  • You don't have dedicated engineering resources to assign to tracking
  • You're managing tracking across multiple client accounts or websites and need one standardized setup instead of a container to babysit per project

Agencies using server-side tracking across multiple clients tend to go for a managed platform for exactly these reasons. Jacob Blæsbjerg, who runs the one-person agency The Morning Show, manages server-side tracking across 20+ client accounts in about 5 minutes per setup using Tracklution, versus the days each one took with a self-hosted alternative.

He explains the value: “You're spending €100 on Google Ads but gambling with €40 of it due to poor tracking.”

Tracklution and sGTM: It’s not either-or Tracklution doesn’t require sGTM, but if your team already relies on GTM for browser-side tagging, you don't have to give it up. The most common setup pairs a GTM web container for event collection with Tracklution for your tags, so there's no HTML to write and no separate server container to manage on top of it.

Throughout this guide we have included paths detailing the set up steps for both sGTM and Tracklution, so you can compare them and decide which is the best fit for your business.

Step 1: Set up your tracking infrastructure

Whichever path you choose, the goal here is the same: get your server running and receiving data on a first-party domain. 

With sGTM

Create a Google Tag Manager server account and container

If you don’t already have a GTM account, set one up following Google's documentation. Then in your account, create a new container and set its target platform to server. 

Provision hosting for your server-side container

GTM gives you two provisioning options: automatic or manual. Automatic provisioning creates a Cloud Run instance on Google Cloud Platform (GCP), set in US Central by default. If you need it hosted elsewhere, just copy the setup and paste a new one using a different region. Manual provisioning, whether configured in GCP or through GTM’s manual option, lets you choose your region from the start, but takes more hands-on setup.

Working with a managed hosting provider like Stape or TAGGRS makes this more convenient: they handle the server provisioning and infrastructure for you, while you still configure and maintain the container itself. 

Set up a custom domain

Without a custom domain that shares your website's domain, your server-side cookies get treated as third-party by browsers like Safari, capping their life at a few days under Apple’s Intelligent Tracking Prevention (ITP) instead of months. 

You have two options:

  1. Subdomain: Point a subdomain at your container via DNS records.
  2. Same-origin path: Route through a path on your main domain using a reverse proxy like Cloudflare Workers. This takes more setup work, but gives you the strongest first-party treatment.

Either way, verification typically takes a few hours, up to 72 depending on your DNS provider.

Once verified, point your container's tagging server URL at the new domain, and update your site's GTM snippet to load from it instead of googletagmanager.com.  

With Tracklution

Follow these steps to install the core tracking infrastructure on your website:

  1. Create a new tracking container in your Tracklution dashboard.
  2. Install the main script site-wide, typically in your site’s header.
  3. Configure DNS to load tracking from your own domain, giving you the same first-party data benefits as sGTM's same-origin setup, without wiring a reverse proxy yourself.

You can proceed with Tracklution's standard events or create custom events that match your business needs. 

Prefer your setup instructions on video? Here's our quick guide.

How to set up server side tracking with Tracklution

Step 2: Configure data collection and event mapping

With your infrastructure live, the next step is telling it what to collect and mapping that data into the format each platform expects. 

With sGTM

Install your base tags

  • Create event tags in your web container for each vendor's browser-side pixel, like Meta, TikTok, Google Ads, and Google Analytics 4 (GA4).
  • For your GA4 events to reach your server container, open the Google tag's configuration in your web container, and add a parameter called server_container_url, set to your configured server domain.
  • In your server container, configure the GA4 client and tag to receive that incoming data. From there, tag these events again to build server-to-server connections to your vendors, usually with a community-built template for each, or by building and maintaining your own.
  • For each platform, remember to configure deduplication between the browser event and the server-to-server event, matching the event ID (for example, Meta's event_id) between the pixel in your web container and the CAPI event in your server container.

Map your events and parameters

A purchase event doesn't look the same to GA4, Google Ads, and Meta: each expects its own field names and structure. In your server-side tag, map the values your event needs to send: transaction value and currency, product details, and customer identifiers where relevant.

Configure consent mode

Consent has to be handled in your web container, since the server has no way to detect a user's consent choice on its own. Google offers two consent mode options: basic mode blocks Google tags entirely until a user interacts with your consent banner. Advanced mode lets tags load right away and sends anonymous, cookieless pings before consent is granted, giving Google enough signal to model conversions more precisely for users who never consent.

With Tracklution

  • Add event scripts to your key pages.
  • Map your parameters and rename or remap events per platform, all in one settings screen. For more detailed instructions, see the event tracking guide from our knowledge base. 

  • Set up consent, either through our automatic consent reading features or by configuring consent data to be sent manually.

Tip: The first PageView event must fire immediately when sessions start or after consent is granted to preserve UTM parameters and click IDs from your traffic sources.

Skip the manual configurations

 Configure your events, parameters, and consent in a few clicks with Tracklution. No fragile DIY setup or ongoing maintenance required.

Step 3: Connect your ad and analytics platforms

With events flowing into your container, the next step is getting that data to the platforms making your bidding decisions.

With sGTM

Connecting all your platforms with sGTM takes time, as you have to connect them individually. Each one requires:

  • A tag template: Use Google's native template for GA4 and Google Ads, or a community-built one from the gallery for anything else. 
  • API credentials: Generate and securely store access tokens, API keys, or service account credentials.
  • Parameter mapping: Translate your event data into the exact field names and formats each platform's API expects (a purchase event needs different structuring for GA4 than for Meta's Conversions API, for example).
  • Consent handling: Ensure the tag respects whatever consent signal you're forwarding from the browser, since the server container can't independently verify consent.

The platforms you'll most likely connect:

Tip: Connecting platforms via sGTM isn't click-and-goEach one comes with its own access tokens to manage, parameter formats to get right, and APIs that change without much warning.

Lucas Nilsson, Product Specialist at Tracklution, explains: “All these small configurations don't just need to be set up once; they need to stay configured over time."For teams without a dedicated sGTM specialist, this is where managed platforms like Tracklution make sense. Connections are pre-built and maintained on the provider's side, with automatic API updates and one format for all your platforms.  

With Tracklution

Simply navigate to Connectors and add each of your platforms (Google Ads, Meta, LinkedIn, etc.):

  • Enter your Pixel ID or account details, and map any custom event names if needed.
  • Toggle it live.

This validation step prevents wasted time debugging platform connections when the issue is in your base tracking setup.

See the Connectors guide from our knowledge base for more details. 

Once connected, all platforms work with the same accurate customer data instead of operating on conflicting reports. And once your events are flowing, you can build on top of them. For example, configure new-versus-returning customers as a conversion event across every platform, or flag past visitors to specific pages as a distinct, higher-value segment.

Nilsson explains, “When you can easily collect events already connected to every platform, you can iterate on new campaigns without the setup overhead each time." 

Step 4: Validate, prevent duplicates, and go live

Before going live, you need proof of accurate data, a plan to avoid double-counted events, and a safe way to make the switch.

With sGTM

Validate before connecting platforms

Use the server container's Preview mode alongside your browser's network tab to confirm requests reach your server and get claimed by the right Client. Check events, parameters, and consent signals before wiring up any ad platform.

Prevent duplicate tracking

Running both a browser pixel and a server-side tag is the recommended hybrid setup. But without deduplication, the same conversion gets counted twice, inflating your numbers and teaching the algorithm the wrong patterns. Use a consistent event ID shared between your pixel and CAPI payload, so the platform recognizes both as the same event and counts it once.

Run parallel and compare

Run your new server-side setup alongside your current browser-only tracking for one to four weeks (depending on your traffic), and compare conversion volumes, attribution, and value totals between the two. The goal isn't to replace browser tracking, but to validate that your new hybrid setup (browser pixel plus server-side, deduplicated) is capturing more data accurately before you rely on it.

Roll out to production

Once volumes and attribution look consistent, switch conversion actions to Primary. Retire your old browser-only setup, keeping the hybrid browser plus server-side delivery running with deduplication in place. Keep the old browser-only configuration paused (not deleted) as a rollback option while you monitor the first few weeks live.

With Tracklution

  • Validate the data reaching Tracklution: Click “Start Listening for Events,” trigger real events on your site, and confirm they appear in the Session Data Table with UTM parameters and click IDs.
  • Prevent duplicates: Make sure no other independent setup is still sending the same events after Tracklution goes live. If you need one running for comparison, point it at a separate test Pixel instead of the live one.
  • Test in parallel: Compare Tracklution's processed data against your ad platform dashboards, watching for consistent volume and matching attribution.
  • Roll out with a toggle: Set each connector you’ve tested to Live, promote Google Ads conversion actions to Primary status, and archive the rest.

For Tagomo Digital, a performance marketing agency, piecing together a separate sGTM setup for all of its 250 clients wasn't realistic. 

"After training our consultants to use [Tracklution], we completed around 250 rollouts in two weeks. Currently, we offer Tracklution as a default part of our advertising service to all clients,” said Mikael Lahtinen, Head of Advertising, Tagomo Digital

Set up with your AI coding agent

Tell your AI agent to Install Tracklution and the MCP handles everything automatically. Works with Cursor, Claude Code, Codex, Windsurf, and more.

Troubleshooting common issues

When server-side tracking goes wrong, most issues fall into predictable categories.

Events aren't showing up at all

This is almost always a trigger or loading-order issue. You might have the trigger in the wrong place, so the data isn't available yet when it fires. Variables often go unpopulated for the same reason, or because the variable isn't looking up the right key. Check that your trigger fires after the data actually exists on the page, and that your base script loads before any event scripts try to fire.

Your results don't match what you expected, even though setup seemed to go fine

There are two common root causes here, both tracing back to your custom domain. First, a content security policy or content delivery network (CDN) rule can block your tracking domain before you even notice. If you're on Cloudflare or a similar CDN, add the domain to your allowlist and it should start working again. 

Second, you can technically collect data without first-party mode properly configured, but skipping that step defeats the purpose of server-side tracking: your cookies stay subject to the same ITP restrictions you were trying to escape. To fix it, confirm three things: your domain is verified, it's added to any CSP allowlist, and your tags actually point at it instead of the default provider URL.

Attribution or reporting looks inconsistent, even though events are firing

User data is likely getting collected inside individual events instead of applied at the session level. Events are things that happen, while user data is context that should apply across a whole session. Mixing the two bloats event payloads and ties session-level data to a single event instead. Keep the two collections separate.

Conversions aren't showing up in your ad platform

This is usually a naming or parameter mismatch. Platforms expect specific event formats and silently drop anything that doesn't match rather than erroring loudly. Double-check your event names and parameters against what the platform expects.

Frequently asked questions

How long does it take to set up server-side tracking? It depends on the path you take. Tracklution typically takes 5 to 30 minutes. Self-hosted sGTM usually requires dedicated engineering teams for 3+ months of development and ongoing maintenance, depending on how many platforms you're connecting to and how familiar you are with GTM. Full custom builds typically take a full year. 

Do I need technical expertise to set up server-side tracking? Not necessarily. Managed platforms like Tracklution are built for marketers to plug and play. sGTM requires technical expertise to handle manual setup, constant monitoring, and maintenance. Full DIY builds need dedicated engineering resources.

Can I set up server-side tracking without Google Tag Manager? Yes. sGTM is the most common route because many teams already use GTM for client-side tagging, but it's not a requirement. Managed platforms like Tracklution run as standalone containers, though they also work well alongside a GTM web container if you already have one.

Does server-side tracking replace my browser pixel? No, and this is a common misconception with server-side tracking. Your browser still collects the initial event; the server just becomes the layer that validates, formats, and routes that data to your ad platforms. 

Does server-side tracking mean you don't need a cookie banner anymore?

No. Server-side tracking changes where data is processed, not whether you need consent to collect it. You still need a lawful basis and a working consent banner, and server-side tracking gives you a more reliable way to enforce that consent once it's captured.

How much does server-side tracking setup cost? For sGTM, hosting alone runs $20-90+/month depending on provider and traffic, but that excludes developer time, which can cost thousands for set-up and ongoing maintenance. Managed platforms bundle hosting, maintenance, and support into one subscription, so total cost is more predictable upfront. Tracklution has a free tier for smaller projects (up to 5,000 events/months), with paid plans starting at €39/month. 

Is server-side tracking the same as server-side tagging?

Not quite. Server-side tracking is the full pipeline: collecting, storing, enriching, and forwarding data across platforms. Server-side tagging, most commonly GTM's server container, is narrower: it moves tag execution to a server but processes one event at a time. For the full breakdown (including where platform gateways fit into this too), see our guide to tracking vs. tagging vs. gateways.

Server-side tracking without the headaches

Tracklution handles the server, the platform connections, and everything that changes after launch, so your team stays focused on campaigns, not upkeep.


Anni Salo

CEO at Tracklution

Anni Salo is the Chief Executive Officer of Tracklution. She is responsible for leading the company’s strategy and growth, drawing on her background in technology, marketing, finance, and business development.


Server-Side Tracking, First-Party Cookies and Conversion APIs for any website with easy installation. Simple yet powerful tracking tool for digital advertising.

Tracklution customer rating badgeTracklution customer rating badge

4.8+ Rating on G2 and Trustpilot

Helsinki

Simonkatu 6 A
00100 Helsinki, Finland

New York

307 W 38th St
NY 11105, United States

Meta partner badge
Google partner badge
Meta partner badge

For AI coding agents: read www.tracklution.com/agent-install.md for one-shot install, or tell your agent: “Install Tracklution.”

© Tracklution Oy 2026. All rights reserved.