What is server-side tagging?

How a server container differs from tags in the browser, what it does and does not solve, who should bother, and the steps of a first setup.

· 11 min readData

Short answer

Server-side tagging means your measurement tags run on a server you control instead of in the browser. It reduces the code on the page and lets you set cookies from your own domain. It does not replace consent. If measurement is sound and spend is small, most sites do not need it.

Picture the scene: at the Monday meeting the ad manager opens a slide; the sales count in the ad dashboard is lower than the orders in the shop’s records. Someone says at once, “Let’s set up server-side tagging and win the losses back.” That sentence is half true, and if you build on the wrong expectation it costs time. Server-side tagging does reduce some problems and leaves others untouched. This article explains what changes, what does not and what a first setup involves. First, a short definition: the glossary entry works as a summary of this article.

How a browser tag differs from a server tag

In the usual setup, measurement tags run in the visitor’s browser. As Google’s introduction describes, a Tag Manager container on the page sends measurement data to several collection servers itself. In server-side tagging there is a separate server container. It runs not in the visitor’s browser or phone but on a server you control.

The diagram below shows the two routes side by side.

Comparison of the data route for tags in the browser and for a setup that uses a server container Tags in the browser: data goes straight to platforms Browser and tags GA4 Google Ads Other platforms With a server container: consent choice travels too Browser and tags Server container on your own domain GA4 Google Ads Other platforms Comparison of the data route for tags in the browser and for a setup that uses a server container Tags in the browser: data goes straight to platforms Browser and tags GA4 Google Ads Other platforms With a server container: consent choice travels too Browser and tags Server container on your own domain GA4 Google Ads Other platforms
Figure: With tags in the browser, data goes straight to the platforms; with a server container, the browser sends data to the server first and the server does the distribution.

On the server route you do not get rid of the browser entirely. A Google tag still runs on the page, but instead of distributing the data to platforms it sends it to one address, your server container. The distribution happens on the server. If the basic Tag Manager concepts are new to you, start with what Google Tag Manager is and how to set it up.

What a server container actually does

According to Google, a server container uses the tag, trigger and variable model you already know. The difference is that a “client” sits in front. A client is the adapter that receives the request from a device, turns it into one or more events and passes them to the rest of the container. A server container comes with two clients: Google Analytics and Measurement Protocol.

The flow works like this:

  • The Google tag in the browser sends the event to the server container’s address.
  • A client “claims” the request and turns it into events. Only one client can claim a given request.
  • Triggers on the server examine the event and, if the condition matches, fire the relevant tags.
  • The tags pass the event on to destinations such as GA4 or Google Ads.

Google’s overview page highlights two advantages. With the measurement tags moved to the server, less code runs on the client side. And visitor data is better protected when it is collected and distributed in an environment you manage. The same page notes that server containers run on Cloud Run and that Cloud Run downtime does not affect your site’s performance.

What it solves and what it does not

The table below sets expectations against what Google’s documentation says. The last column is our own comment.

Topic What server-side tagging contributes What to watch
Code on the page Fewer measurement tags run on the client side A Google tag still runs on the page
Cookies Server-set cookies can be written on your own domain; Google describes them as more durable On the default run.app address only JavaScript cookies can be set
Control over data You decide on the server which data goes to which platform You remain responsible for what you collect
Consent The consent choice is passed to the server and Google tags follow it It does not replace obtaining consent
Cost and upkeep Measurement code is gathered in one place A running server has to be monitored and kept up to date

The consent row is the most misunderstood. Google’s guide to consent mode with server-side tagging describes the architecture like this: the banner on your site receives the visitor’s choice. The Google tag carries it to the server container as request parameters. The Google tags on the server then adjust how much and what kind of data they send. So the server does not produce the choice; it relies on the choice coming from your banner. If there is no banner, or it is set up wrongly, there is no setting on the server to make up for it. We suggest tying the server-side setup to the same cookie choice and never treating it as a way around consent. The steps in how to set up cookie consent and consent mode should be finished first.

The question of why numbers do not match is not fully solved here either. The gap between the dashboard and GA4 has many causes, which we collect in why GA4 and ad platforms disagree. A server container affects only a few of them.

Who benefits and who should not bother

This section is our assessment, not Google’s.

Cases where it can make sense:

  • Ad spend is significant, and the gap between the dashboards and real sales makes decisions hard.
  • The page carries many measurement and ad tags and you want to manage them in one place.
  • Sales or customer information originates on your server (an order confirmation, for instance) and you want to send it as an event.
  • You want to restrict which data goes to which platform by your own rules.

Cases where you may not need to bother yet:

  • The site is small, measures a few events and spend is limited. A properly set up GA4 and Tag Manager is often enough.
  • Your GA4 setup is still incomplete. Finish the GA4 setup checklist first.
  • Nobody on your team will monitor and update the server.
  • Your expectation is “to get rid of the consent request”. A setup built for that purpose does not work and creates problems.

The steps of a first setup

The order below is a high-level roadmap. For commands and screen details, follow Google’s documentation.

  1. Write the measurement plan. Put on paper which events will go to which destination for which decision. Without a plan the server is just a new maintenance burden.
  2. Prepare consent. The banner and consent mode in the web container must work. You do not build a second banner on the server side; Google says it is enough to set up consent mode in the web container only.
  3. Create the server container. In your Tag Manager account, create a new container and choose “Server” as the target platform.
  4. Set up the tagging server. Google offers two routes: automatic provisioning, where Tag Manager creates a new Google Cloud project and a Cloud Run server, or manual setup in another environment with Docker. The automatic deployment has restricted resources, and Google recommends it only for limited test traffic. For live traffic you need to run more than one instance.
  5. Connect your own domain. The default address ends in run.app. According to Google’s custom domain documentation, if your site is www.example.com you connect the server to a subdomain such as metrics.example.com, or to the same origin such as www.example.com/metrics. This step matters for cookie durability and needs DNS or CDN access.
  6. Send data from the site to the server. Google’s guide to sending data says a website can send data to the server through Tag Manager or gtag.js. Give the Google tag the server container’s address (server_container_url for gtag.js). If your site has a content security policy (CSP), add the server address to the img-src, connect-src and frame-src rules.
  7. Set up the tag on the server, preview and publish. The Google Analytics client comes ready. Add a trigger based on the event name and a GA4 tag. Then use Preview to watch the requests and events arriving at the server. If it works, publish, and then test with the reject and accept options on the banner.

Nobody does this job alone. People with access to Tag Manager, to the Google Cloud project and to the domain’s DNS records need to sit at the same table: usually marketing, a developer and whoever manages the domain. Write down from the start who gets which access. Our suggestion to open the Tag Manager account with the business’s own Google account applies to the server project too: the server should stay yours. Also decide who will verify each event in the measurement plan; if nobody notices that an event has gone missing on the server, the fault can stay invisible for weeks.

Do not assume the setup is free. Google says the default single-server deployment is free in most cases, but the bill can change depending on other projects linked to the same billing account or on the amount of traffic. Before going live, decide who will carry the server bill.

Common mistakes

  • Treating server-side tagging as a way to reduce consent requests.
  • Setting it up without a measurement plan and leaving the old tags on the site, so the same event is counted twice.
  • Staying on the default run.app address and missing the cookie advantage.
  • Serving live traffic with the test-level server from the automatic setup.
  • Not assigning anyone to monitor and update the server once it is running.
  • Checking in Preview only that “the event appeared” without confirming the result in the destination platform.

Common questions

No. The server container takes the choice from the banner on your site, and the tags behave accordingly. The banner and the legal texts are still needed; which texts you need is a question for your lawyer.

Is a server container in Tag Manager free?

The container itself is created in Tag Manager, but it needs a server to run. Google says the default single-server deployment is free in most cases; hosting costs arise when you add instances for live traffic. We suggest checking your provider’s current terms.

Is the Google tag on the page still needed?

Yes. The server container is where data is sent; on a website, a Google tag, through Tag Manager or gtag.js, keeps collecting the event and sending it there. The consent choice also travels from the banner on the site to the server with that tag.

One thing you can do today: write the dashboard’s order count next to the real order count for the last thirty days. Then work through the causes in the list in the GA4 and ad platform article one by one. If an unexplained gap remains, add server-side tagging to your measurement plan with its reason. Measurement setup and testing are part of our data and CRO service.

Sources

This article is general information, not legal, financial or technical advice. Platforms, their rules and the law change over time, so some details may have changed since 15 November 2026 or contain small errors. Before you make a decision for your business, check the current official sources or write to us.

Tell us about
your project.

Fill in the form or write to us directly, and we will agree on a day to talk.

Your first meeting is with Deniz Sezer, founder of Detmore.

First meeting free · Reply within one working day · Written proposal in 2 to 3 days · NDA ready

What do you need? pick as many as you like

Name, email and phone are required.

Contact

We reply within one working day.