Marketing Analytics

Server-Side Tagging: What It Is, Costs and How to Set It Up (GA4)

Server-side tagging explained: what it is, what it costs to host, how to set it up with a GTM server container for GA4, and the mistakes to avoid. Read the guide.

JG
Jon Goodey
Founder & CEO
Updated 10 min read

Server-side tagging is a way of collecting analytics and advertising data through a server you control, rather than sending it straight from the visitor’s browser to Google, Meta and other vendors. In Google Tag Manager (GTM) it means adding a server container that receives data from your site, processes it and forwards it to GA4 and other tools. This guide covers how it works, what it costs, how to set it up for GA4, and where it goes wrong.

What is server-side tagging?

With traditional client-side tagging, the visitor’s browser loads each vendor’s script and sends data directly to that vendor.

With server-side tagging:

  1. The visitor loads your site, which sends a single stream of data to a tagging server on your own domain.
  2. The tagging server receives that data, can clean or enrich it, and checks consent.
  3. The server forwards the data to GA4, Google Ads, Meta and any other destination.

The server is still a tagging tool. It does not make tracking invisible, and it does not remove the need for consent where consent is required.

Why server-side tagging matters

Data quality. Browsers and extensions restrict third-party scripts and shorten cookie lifetimes. Serving tags from your own domain and setting first-party cookies from the server can reduce some of that loss. How much you recover depends on your audience and set-up, so measure it on your own data rather than relying on a quoted percentage.

Page weight. Fewer vendor scripts in the browser means less JavaScript to run, which can help loading and interaction metrics. The gain depends on how many tags you currently load.

Control. Because data passes through your server first, you can remove personal data, hash identifiers and decide which vendors receive which events.

How to set it up with a GTM server container (GA4)

You need a web GTM container already installed, a GA4 property, and a Google Cloud project or an account with a managed hosting provider.

  1. Create a server container. In Tag Manager, choose Create Container and select Server. GTM offers automatic provisioning on Google Cloud, or you can set up hosting manually.
  2. Provision hosting. Automatic provisioning creates the tagging server on Google Cloud Run. Use a production set-up, not the testing server GTM offers, which is not meant for live traffic.
  3. Map a custom domain. Point a subdomain of your own site, such as data.example.co.uk, at the tagging server. Serving from your own domain is what allows first-party cookies.
  4. Send web data to the server. In your web container, set the GA4 configuration to use the server’s address as its transport URL, so events go to your server rather than directly to Google.
  5. Add the GA4 client in the server container. The GA4 client receives the incoming events.
  6. Add a GA4 tag. Create a GA4 tag in the server container that forwards the received events to your GA4 property.
  7. Test in preview mode. Use preview on both containers. Check that each event arrives at the server, is processed and is accepted by GA4, then confirm it in GA4 DebugView.
  8. Publish and monitor. Publish both containers, then compare event counts with the old set-up for a few weeks before removing the old tags.

Screenshots: screenshots of the container settings screens should be added from a live set-up before this guide is final.

Hosting options and monthly cost

You have two main routes.

OptionWhat it isCostBest for
Google Cloud Run (self-managed)You run the tagging server in your own Google Cloud projectPay for what you use. Check Google Cloud’s current pricingTeams comfortable with cloud billing and monitoring
Managed hosting, such as StapeA provider runs the tagging server for youPlans priced by request volume. Check the provider’s current pricingTeams that want less setup and no cloud administration

Prices change, so we have not quoted figures here. Check each provider’s pricing page for your expected request volume. Whatever you choose, budget for set-up time, testing and ongoing monitoring as well as the hosting bill, and run more than one server instance in production so a single failure does not stop your data.

Server-side tagging does not replace consent. If you serve visitors in the UK or EEA, your consent banner still needs to record their choice, and your tags need to respect it.

Consent Mode v2 passes the visitor’s choices on advertising storage, analytics storage and the two advertising data signals to Google’s tags. Set it up in the web container first, then check that the consent signals reach the server container and that tags only fire when allowed. Test both the accepted and declined paths.

Meta Conversions API

The Conversions API lets your server send conversion events to Meta directly, alongside or instead of the browser pixel. In a GTM server container this is done with a Meta tag.

Two points matter in practice:

  • Deduplication. If you send the same event from the browser pixel and from the server, include a shared event ID so Meta counts it once.
  • Consent. Send events only for visitors who have agreed to advertising cookies, and hash any customer details before sending.

Common mistakes

  • Using the testing server for live traffic. It is not built for production load.
  • Skipping the custom domain. Without your own subdomain you lose the main cookie benefit.
  • Duplicate events. Running client-side and server-side GA4 tags together without a plan double-counts.
  • Ignoring consent. Moving a tag to the server does not change what you are allowed to send.
  • No monitoring. A failed tagging server loses data silently. Set alerts for errors and traffic drops.
  • Doing too much at once. Get GA4 working first, then add other destinations one at a time.

How to measure the impact

Compare, over the same period before and after the change:

  • Sessions and conversions in GA4 against your back-end orders or enquiries
  • Page speed and Core Web Vitals on key templates
  • Event counts by source, to spot duplication or loss

FAQ

What is server-side tagging in simple terms?

It is collecting website tracking data through your own server instead of sending it from each visitor’s browser to every vendor separately.

Is server-side tagging worth it?

It is worth considering if you rely on advertising platforms, lose data to browser restrictions, or want tighter control over what is shared. For a small site with few tags, the cost and upkeep may outweigh the benefit.

No. Consent rules apply to the data you collect, wherever the tag runs.

How long does it take to set up?

A basic GA4 set-up can be done in a day or two. Adding consent handling, advertising platforms and testing takes longer.

Can I do it without a developer?

A marketer comfortable with GTM can do a basic set-up, particularly with managed hosting. A developer helps with custom domains, hosting and anything beyond standard tags.

Getting help

If you want this set up and tested, see our marketing analytics services, or explore our learning hub.

Related reading: an AI governance framework UK organisations will actually use, for where data and AI decisions need a named owner.

JG

Jon Goodey

Founder & CEO

Jon is the founder of Indexify, helping UK businesses leverage AI and data-driven strategies for marketing success. With expertise in SEO, digital PR, and AI automation, he's passionate about sharing insights that drive real results.

Related Resources

Continue Reading

How Indexify can help

Ready to Put These Insights Into Action?

Explore our services or get in touch to discuss your marketing goals.