Skip to main content

Server-side tracking for your website

Server-side tracking moves your measurement from the browser to a server you control, giving GA4, Meta and Google Ads a more complete and accurate data foundation. I have been a developer since 2010 and set it up hands-on with server-side GTM, Meta CAPI and Consent Mode v2. Everything is documented so you can take over the setup yourself.

  • I usually reply the same day
  • Written estimate before work starts
Mikkel Tschentscher

star reviews

Read every review
  • A fast, trouble-free process

    Mikkel delivered competent, professional work setting up my website. Everything ran quickly and without a hitch.

    Sisse Find(translated from Danish)
  • My go-to guy

    That is why I can still give Mikkel my very best recommendations.

    Janni E Clausen (Janniclausen)(translated from Danish)
  • Competent, flexible and helpful

    Probably the best developer ever in the digital industry. Mikkel is incredibly competent, flexible and helpful. On top of his outstanding skills, he delivers far beyond expectations. A huge recommendation from me!

    Prince Jamal Minhas(translated from Danish)

Server-side tracking

Why the browser is no longer enough

Safari limits the lifetime of cookies set from JavaScript, ad blockers stop known measurement scripts, and a share of visitors decline tracking in the banner. Together this means classic browser measurement sees fewer conversions than actually happen, and the gaps are spread unevenly across channels.

Server-side tracking fixes the technical part of that problem. Measurement runs from your own subdomain as first-party data, so it survives browser restrictions far better. Consent is still respected; when a user says no, I forward nothing.

A typical setup

  • A server-side GTM container on your own subdomain, e.g. data.yourdomain.com, so measurement is first-party throughout.
  • GA4 with correct ecommerce tracking and conversions defined on what the business actually lives from.
  • Meta Conversions API with event IDs and deduplication, so the same purchase is never counted twice.
  • Google Ads conversions and Enhanced Conversions, sent from the server.
  • Consent Mode v2 wired to your cookie banner, so the consent signal travels the whole way.

Documented, so you own it

I always hand over an overview of which fields are sent to which platforms, and why. That overview is worth its weight the day someone asks about a data processing agreement, or the day a new partner needs to understand the setup.

There is no lock-in with me. The container lives in your own Google account, the documentation stays with you, and you can hand operations to someone else at any time. The documentation is not an appendix; it is what keeps the setup maintainable when people change jobs.

What is server-side tracking?

Server-side tracking means your measurement events are sent through a server you control, instead of straight from the visitor's browser to Google, Meta and other platforms. In practice the server is usually a server-side container in Google Tag Manager, running on a subdomain of your own domain. The browser sends one event to your server, and the server distributes it to the platforms you use.

The reason it has become relevant is that the browser has become an unreliable place to measure from. Safari and Firefox restrict cookies, ad blockers strip measurement scripts, and third-party cookies are on their way out. At the same time, consent rules require that tracking only runs for users who said yes. Server-side tracking solves the technical part: better data quality and longer cookie lifetimes for visitors who gave consent. It is no shortcut around the rules, and you should be sceptical of anyone selling it as one.

Who needs it? First of all webshops and businesses spending money on Google Ads or Meta advertising. When the platforms lack conversion data, their algorithms optimise on a flawed basis and budget gets allocated accordingly. Lead-based businesses benefit too, because form submissions and call clicks get measured more reliably.

I set it up hands-on: server-side GTM on your subdomain, GA4, Meta CAPI with deduplication, Google Ads conversions and Consent Mode v2 wired to your existing cookie banner. The old and the new measurement run in parallel along the way, so we can compare before anything is switched off.

Drawbacks and limitations of server-side tracking

Server-side tracking does not solve everything, and it is better to know the limitations before you start. The most important one is that consent applies exactly as before. If a visitor says no in the cookie banner, the server may not forward the event to Google or Meta. The setup gives you better data about the visitors who said yes, but it does not give you more of them. The gap between your own numbers and the platforms' will therefore never disappear entirely.

Then there is operations. With client-side tracking everything runs in the browser, and there is nothing to host. With server-side tracking you typically have two containers in Google Tag Manager, a web container and a server container, and the server has to run somewhere, be kept up to date and be paid for on an ongoing basis. There are more links that can break, and when something fails, someone needs to know where to look. That takes documentation and a person who owns it.

Finally, the server does not fix a poor data structure. If the site sends wrong values, lacks product data or records the same purchase twice in the browser, the error simply follows along to the server. That is why I start by getting the data layer and the existing measurement in order. And some tools still belong in the browser, such as heatmaps and session recordings that need to see what happens on screen.

Where the container runs: Stape, Google Cloud or your own server

A server container in Google Tag Manager is only a configuration until it gets a server to run on. The setup itself lives in your GTM account, while the server is what receives events from the browser and forwards them. There are basically three ways to host it, and the choice affects operations, the ongoing cost and how much you have to keep an eye on yourselves.

For most small and medium-sized businesses the simplest option is a specialised host such as Stape, built for exactly server-side GTM. You create a container, get a subdomain connected and manage the server from a control panel without running it yourself. The alternative is Google Cloud, where Google itself offers an automatic setup straight from Tag Manager. It suits businesses that already have a Google Cloud account and IT people who want everything in one place, but scaling, updates and monitoring are then your responsibility.

The third option is running the container with another cloud provider or on your own server. It can be done, but it is rarely worth the trouble unless you have an operations team that already runs that kind of thing. Whatever the choice, there are two things I always clarify: where the server physically sits, and whether there is a data processing agreement with the provider. Those are questions your lawyer or DPO will typically ask, and the answers go into the documentation.

Meta Conversions API and Google Ads enhanced conversions

Two of the most common reasons for choosing server-side tracking are Meta's Conversions API and Google Ads enhanced conversions. The Conversions API, often shortened to CAPI, is Meta's way of receiving events directly from a server instead of only from the pixel in the browser. Meta itself recommends running the two side by side, so the pixel and the server send the same event and Meta then removes the duplicate.

That requires both copies to have the same event name and the same event ID, otherwise the purchase gets counted twice. On top of that, the server can send customer details such as email and phone number in hashed form, so Meta can better link the event to a profile. How well that works can be followed in Events Manager, where events get a score for how well they are matched (Event Match Quality).

Enhanced conversions in Google Ads builds on the same idea. When a customer buys or fills in a form, the customer's email or phone number is sent hashed with the conversion, and Google matches it against its own signed-in users. The point is that Google can tie more conversions to the ad that led to them. Both may only happen for visitors who have consented to marketing, and in Consent Mode that is governed by the ad_user_data signal.

Server-side tracking across Denmark

I help businesses with server-side tracking across all of Denmark. My base is in Glostrup just outside Copenhagen, but the work lives in Google Tag Manager, in your DNS and in your ad accounts, so it can be done just as well for a webshop in Aalborg as for a company in Frederiksberg.

For clients in and around Copenhagen I am happy to meet in person when it makes sense. For businesses in Aarhus, Odense, Aalborg and the rest of the country the work typically runs over video calls and screen sharing, which in practice works at least as well, because we can look at the actual setup together.

A typical engagement starts with a short review of your current measurement, after which I give you a concrete quote for the setup. The work itself usually takes a few weeks from start to finished reconciliation, depending on how many platforms need connecting.

The advantage of a freelancer over an agency is that you talk directly to the person doing the work. No project managers in between and no subscription; you get a setup that is documented and can be maintained by anyone afterwards. Write to hello@mikkeltschentscher.dk or call +45 22 51 31 79 and you will hear back the same day.

The decisions you will need to make

Practically, a subdomain needs to be created and pointed at the container. That is a five-minute DNS change once the right person has access, and I am happy to guide your IT people or handle it myself.

More important are the decisions about data. Which fields should go on to the ad platforms, and which should stay with you? There is rarely a good reason to send everything. Should email addresses go along in hashed form for Enhanced Conversions, should phone numbers, should order value? I bring a recommendation for each point, but the choice is yours, and it gets written down so it can be found again later.

Finally there is operations. A server-side container has an ongoing hosting cost and needs an eye on it like anything else running in production. For most Danish businesses it is a modest line item compared with the value of accurate conversion data, but it belongs in the calculation from the start, and I put the numbers on the table before we begin.

What you get

Concrete deliverables, not a report of recommendations someone else has to find time for.

  • A container on your own subdomain

    Server-side GTM running under your domain, so cookies and measurement are first-party data end to end.

  • Platforms connected

    GA4, Meta CAPI and Google Ads conversions set up with deduplication, tested event by event.

  • Written documentation

    An overview of which fields go where, so the setup is yours and anyone can take it over.

  • The numbers verified

    Conversions checked against your orders or leads for a period, so you know the new setup lands correctly.

View all cases

How it works

Four steps. You know what happens when, and you can stop after any of them.

  1. 01 / 04

    Audit of the current setup

    Using preview mode and the network log, I work out which tags fire, which fail, and where the same purchase gets counted more than once. The result is a concrete list of what has to go and what is missing.

  2. 02 / 04

    A new structure in GTM

    The container is rebuilt with consistent naming and a clean data layer, so anyone can open it a year from now and understand what happens. Old tags are archived rather than deleted, so nothing is lost.

  3. 03 / 04

    Server-side and consent mode

    I set up a server container on your own subdomain and wire in consent mode, so the consent choice controls what gets sent. Conversion tracking for Google Ads and Meta moves over with it.

  4. 04 / 04

    Checked against order data

    For a period after launch, I compare orders in your backend with the numbers in GA4 and the ad platforms. Deviations are explained in writing, so you know how much weight the numbers can carry.

Brands I've worked with

  • MT Højgaard Danmark
  • Egmont
  • NNIT
  • Visma
  • Lomax
  • Pascal
  • able.
  • OOONO
  • Novo Nordisk Fonden
  • Energii
  • Maersk Tankers
  • Nordkysten Entreprenørfirmaet

Frequently asked questions

What does server-side tracking cost?

It depends on the scope. The three things that matter most for the price are the number of platforms to connect, the state of your current setup and the hosting choice for the container. Send me a link to your site and a few words about what you use today, and you get a concrete quote with a same-day reply.

What is an example of server-side tracking?

Take a purchase in a webshop. When the customer completes the order, the browser sends one event to your own tracking server on a subdomain, e.g. data.yourdomain.com. The server forwards the purchase to GA4, to Meta's Conversions API and to Google Ads. Without server-side tracking, each platform would need its own script running in the customer's browser. Consent still applies: if the customer said no, the server does not forward the purchase.

How do you set up server-side tracking?

Server-side tracking with Google Tag Manager is typically set up like this. You create a server container in GTM and host it, for example with Stape or on Google Cloud. You point a subdomain of your own domain at the container. The web container sends events to the server instead of straight to the platforms, and in the server container you connect GA4, Meta and Google Ads. Consent from the cookie banner has to travel the whole way, so nothing is forwarded without a yes. Finally you test that the numbers match your orders or leads before the old measurement is switched off.

What is the difference between client-side and server-side tracking?

Client-side tracking sends data straight from the visitor's browser to the platforms and is vulnerable to ad blockers and cookie restrictions. Server-side tracking sends data via your own server. That gives more complete data and full control over what gets forwarded. Most setups combine the two.

What is Stape?

Stape is a hosting service specialised in server-side Google Tag Manager. Instead of you setting up a server on Google Cloud yourself, the server container runs at Stape, which handles operations. The container and its configuration still live in your own GTM account, so you can move to another host later without rebuilding everything, although any Stape-specific add-ons would need replacing. Stape is not a requirement, just one of several ways to host the container.

When does server-side tracking make sense?

Server-side tracking makes most sense when conversion data steers an ad budget, typically in a webshop or a lead business advertising on Google Ads or Meta. A good sign is a noticeable gap between your own orders or leads and what the platforms report. For a smaller site without advertising, well-functioning measurement in the browser (client-side tracking) with GA4 and Consent Mode is usually enough. And if the basic measurement is not in order, that needs fixing first.

Does server-side tracking solve the ad blocker problem?

Partly. When measurement is sent to a subdomain of your own domain instead of to Google's and Meta's well-known addresses, fewer events get blocked. But some ad blockers recognise first-party setups too, so some data is still lost. And it is no way around consent: if the visitor said no in the cookie banner, the server forwards nothing, whether there is an ad blocker or not.

Do you only work in Copenhagen?

No. I am based in Glostrup near Copenhagen and happy to meet clients in the capital area in person, but I have clients all over Denmark. Setups for businesses in Aarhus, Odense and Aalborg run over video calls and screen sharing, and that works just as well.

Is server-side tracking legal under GDPR?

Yes, when it is set up correctly. Server-side tracking does not change the consent requirements; if the user said no, nothing may be measured, regardless of where the measurement technically happens. In return you get better control, because you decide and document which fields get forwarded. I am not a lawyer, but I make sure the consent signal is respected throughout and that documentation exists for a lawyer to work from.

Can we keep our current tracking in the meantime?

Yes, and I recommend it. The old and the new setup run in parallel for a period so we can compare the numbers before the old one is switched off. That way we know whether a difference comes from the new setup or from something else entirely.

Does server-side tracking work on Shopify?

Yes, and there is often a lot to gain, because Shopify has locked down scripts in checkout. The setup builds on Customer Events, and I have a separate page about server-side tracking for Shopify.

Do we have to host and maintain the container ourselves?

The container has to be hosted somewhere, typically with a cloud provider or a specialised host, and I help choose and set that up. Ongoing maintenance is limited, and because everything is documented, your own people or another partner can take it over at any time.

Does it require a new cookie banner?

Rarely. The banner has to be able to pass the consent signal on via Consent Mode v2, and most common solutions can. If yours cannot, I will say so honestly, but I never suggest switching for its own sake.

Your next step

Get a quote for Server-side tracking

Tell me about your project. I’ll get back to you with questions, options and a concrete next step.