Server-side tracking is often sold as a cure for lost conversions. It is a useful piece of infrastructure, and it solves some problems well. This guide separates what it changes from what it does not, so you can decide whether to build it and do it properly if you do.
What is server-side tracking?
In ordinary client-side tracking, scripts in the visitor's browser send data straight to each analytics and ad company. In server-side tracking, events go to a server you control first. That server decides what to keep, change or remove, and what to forward.
The term covers two things:
- Server-side tagging. A tag manager running on a server. In Google's version, a server container uses tags, triggers and variables like a web container, but runs in your Google Cloud project or another environment you choose.
- Server-to-server integrations. Your backend, store or CRM sends events straight to a platform's API, such as Meta's Conversions API.
Client-side vs server-side tracking
| Question | Client-side | Server-side |
|---|---|---|
| Who sends to vendors? | The visitor's browser | Your server |
| Control over data shared | Limited once vendor scripts run | You can filter and reshape before forwarding |
| Offline and backend events | Hard | Natural fit |
| Cost and skills | Low | Hosting, setup, monitoring and updates |
| Failure risk | Browser blocking and script errors | All of those on the way in, plus your server and mappings |
| Consent | Required where law requires it | Still required |
How server-side tagging works in Google Tag Manager
- The website sends a request to your server URL. With the Google tag, this is set with the
server_container_urlsetting. - A client in the server container claims the request. Google describes clients as adapters that turn incoming data into events. A Google Analytics 4 client is pre-installed.
- Triggers check each event and fire tags.
- Tags send data on to GA4, ad platforms or other endpoints, with whatever changes you configured.
Server-side tags run in a sandbox with permissions that show what each tag can do. Review community templates before adding them, in the same way you would review any code that handles customer data. See Google's guide to sending data to a server container.
Benefits of server-side tracking and their limits
| Claimed benefit | What is reasonable to expect | Limit |
|---|---|---|
| Better data control | You can remove or hash fields and decide what each vendor receives | Only if you configure it; a pass-through setup changes little |
| Faster pages | Possible if you remove browser scripts that the server now replaces | Adding a server while keeping every script gains nothing |
| More durable cookies | Same-origin servers can set first-party cookies in server responses | Browser rules still apply and can change |
| More complete conversions | Backend events such as paid orders can be sent even if a browser tag fails | Matching to ads still needs identifiers and consent; no fixed uplift is guaranteed |
| Security of secrets | API tokens can stay on the server rather than in page code | The server must be secured and updated |
What Safari does with cookies
WebKit's tracking prevention policy says Safari's Intelligent Tracking Prevention deletes cookies created in JavaScript, and other script-writable storage, after 7 days without user interaction with the site. It also caps cookies set in HTTP responses to 7 days when it detects third-party CNAME cloaking or third-party IP address cloaking. In plain terms, pointing a subdomain at an unrelated host does not automatically give your cookies a long life. How your server is hosted and routed matters.
Subdomain, same origin or default domain
Google's custom domain guide compares three options:
| Option | Example | Google's description |
|---|---|---|
| Same origin (best practice) | www.example.com/metrics | Full access to server-set cookie benefits; you configure a CDN or load balancer to forward requests |
| Subdomain | metrics.example.com | Google lists full server-set cookie benefits; needs DNS changes |
| Default domain | The host's default address, such as a run.app URL | No server-set cookie benefits; only JavaScript cookies |
Read Google's table alongside the WebKit rules above. A subdomain that resolves to infrastructure treated as third-party may still be capped in Safari, so test the actual cookie lifetime after launch.
Server-side tracking and GDPR, consent and privacy
Moving a tag to a server does not remove your legal duties. If consent is required to store or read information on a device, or to share personal data for advertising, that still applies. Sending data from your server can also be less visible to visitors, which makes honest notices more important, not less.
- Use a consent banner or consent management platform, and pass the choice to the server.
- Google's consent mode guide for server-side tagging says a web container collects consent and the server container acts on the signals. Consent mode itself does not provide the banner.
- Check every non-Google tag separately. Do not assume it reads Google's consent signals.
- Send only what each destination needs. Remove personal data from URLs.
- Set log retention and access rules. Server request logs can contain personal data.
- Review contracts, data transfer rules and sector laws, such as health privacy rules, with qualified counsel.
Hashing an email address is not the same as making it anonymous. Platforms use hashed data to match people.
What does server-side tracking cost?
Google's Cloud Run setup guide estimates that each server in its configuration, with 1 vCPU and 0.5 GB of memory with CPU always allocated, costs about $45 a month. It recommends at least 2 instances to reduce the risk of data loss during an outage, though you may run fewer. Google expects autoscaling of 2 to 10 servers to handle about 35 to 350 requests per second, depending on your tags. It also warns that default request logging can create significant charges for servers handling many requests, such as more than 1 million a month, and suggests disabling or reducing it.
| Cost item | What to budget for |
|---|---|
| Hosting | Cloud Run, another cloud or a managed server-side GTM host |
| Logging and network | Depends on traffic and settings |
| Setup | Developer or specialist time for domain, mapping, consent and testing |
| Maintenance | Server image updates, API changes, monitoring and retesting |
Google recommends keeping the tagging server updated because new versions include security fixes.
Server-side tracking value calculator
This is a planning tool, not a prediction. The extra conversions figure is the weakest input: you can only know it by measuring. Try zero and see whether the project still makes sense for control and data quality alone.
Would it pay for itself?
Is server-side tracking worth it for you?
| Signs it may be worth it | Signs to wait |
|---|---|
| Significant ad spend where conversion data drives bidding | Basic events are still broken or double counted |
| Important outcomes happen in your backend or CRM | Low traffic and few conversions |
| You need tight control over what vendors receive | No consent setup yet |
| Someone owns monitoring and updates | No one will maintain the server |
First get ordinary measurement right with our GA4 conversion tracking guide. Many problems blamed on browsers turn out to be wrong triggers or missing tracking on one form.
Google tag gateway for advertisers as a lighter option
Google tag gateway for advertisers serves the Google tag from your own domain through your CDN, load balancer or web server, and sends some measurement requests to Google through that domain. Google says it recommends it for the most durable tag configuration. It is not the same as a server container: it concerns Google tags and does not give you a place to transform data for many vendors.
How to set up server-side tracking
- Write a data map. List each event, its source, destinations, fields, consent requirement and owner.
- Fix and test the current web tracking. Record a baseline from your CRM or store.
- Create a server container in Google Tag Manager.
- Deploy the tagging server. Google offers a Cloud Run guide, an App Engine guide and manual setup; third-party hosts are another route.
- Map your domain as same origin or a subdomain.
- Point the web tag to the server with the server container URL, and update your content security policy if you use one.
- Configure clients and tags for each destination, starting with one, usually GA4.
- Pass consent and check that each tag behaves correctly when consent is denied.
- Preview and debug both containers, then compare with your baseline for a few weeks.
- Monitor. Alert on errors and sudden drops, set a billing alert and schedule updates.
Debugging in preview mode
Server-side preview shows incoming requests, which client claimed each one, which tags fired and what they sent. If a request never appears, check the server URL and domain mapping. If it appears but no client claims it, check the client settings and request path. If a tag fires but data is missing in the destination, inspect the outgoing request and the destination's own test tool.
Server-side tracking for Google Analytics 4, Google Ads and Meta
GA4
The web tag sends events to your server, the GA4 client receives them and a GA4 tag in the server container forwards them. Check that sessions, sources and key events match your baseline after the change.
Google Ads
Server containers can run Google Ads conversion tags. Keep click identifiers intact, avoid counting the same sale twice through two methods and follow current Google Ads setup guidance. For sales that close later, offline conversion imports from your CRM are a separate job from server-side tagging.
Do enhanced conversions for leads need server-side tracking?
No. Google describes enhanced conversions for leads as an upgraded form of offline conversion import that uses hashed user-provided data, such as an email address from a lead form. It can be set up with the Google tag or Google Tag Manager, and no server container is required. Google says that if you do use server-side Tag Manager or Google tag gateway, user data is encrypted before Google receives it, currently for Google Ads tags only. Two recent changes matter. Since April 2026, enhanced conversions for web and for leads have been a single setting. Google's help page also says that from June 15, 2026, these uploads and offline conversion imports move to the Data Manager API and are blocked in the Google Ads API, apart from legacy access for developer tokens that qualify.
Meta Pixel and Conversions API
When Meta receives the same event from the browser pixel and the Conversions API, it needs a way to remove the duplicate. Meta's deduplication guide recommends matching an event ID: the pixel's eventID must equal the API's event_id, and the event names must match. Matching events sent to the same pixel within 48 hours are deduplicated. See our Conversions API guide.
Bing server-side tracking with Microsoft Advertising
Microsoft Advertising has a Conversions API, which it describes as its server-side solution for sending conversion and customer interaction data from your systems. Microsoft says it can carry website events, CRM events, offline sales and mobile events. It works alongside Universal Event Tracking (UET). Check Microsoft's guide for access requirements in your account, identifiers, consent signals and how to avoid counting an event twice.
Klaviyo and other tools
Other platforms offer their own APIs or server tag templates. Check each vendor's current documentation for required identifiers, consent handling and deduplication rather than copying a GA4 setup.
Server-side tracking for Shopify, WooCommerce and WordPress
| Platform | Common routes | Check |
|---|---|---|
| Shopify | Official channel apps with server connections, or an app or custom pixel feeding a server container | Checkout events, order IDs and whether two apps send the same purchase |
| WooCommerce and WordPress | A plugin that pushes events to the data layer or sends server events | Plugin updates, caching, consent plugin compatibility and duplicates |
| Custom sites | Backend sends events when orders or leads are saved | Retries that could resend the same event; use stable IDs |
Server-side tracking tools
Tools fall into groups. Choose by what you need, and check current features and prices directly:
- Server-side Google Tag Manager on your own cloud, for flexibility.
- Managed hosting for server-side GTM, for less infrastructure work.
- Platform connections such as store apps that include a server integration.
- Customer data platforms that route events from servers and apps.
- Analytics suites with their own server collection options, including some privacy-focused tools.
Ask where data is processed and stored, how consent is handled, how duplicates are prevented, how you export or delete data and what happens if you leave.
Testing after launch
- Compare orders or leads in your system with each platform by ID where possible.
- Confirm events fire once, with the right values and currency.
- Test consent granted and denied, and inspect outgoing requests.
- Check cookie lifetimes in Safari and other browsers you care about.
- Simulate a server error and confirm you get an alert.
- Keep a rollback plan: the previous container version and web-only setup.
Server-side tracking improves plumbing, not strategy. If you want help deciding or auditing a setup, our performance marketing team can help, and our attribution guide explains how the data is then credited to channels.
Sources
- Google Ads Help: About enhanced conversions for leads. support.google.com
- Google for Developers: An introduction to server-side tagging. developers.google.com
- Google for Developers: Set up server-side tagging with Cloud Run. developers.google.com
- Google for Developers: Custom domain configuration. developers.google.com
- Google for Developers: Send data to server-side Tag Manager. developers.google.com
- Google for Developers: Consent mode with server-side Tag Manager. developers.google.com
- Google for Developers: Set up Google tag gateway for advertisers. developers.google.com
- WebKit: Tracking prevention in WebKit. webkit.org
- Microsoft Learn: Conversions API integration. learn.microsoft.com
- Meta for Developers: Handling duplicate Pixel and Conversions API events. developers.facebook.com