AdPix Blog

Server-side tracking: what it fixes, what it costs and what to move first

Server-side tracking explained: client vs server-side tagging, what it fixes for ad blockers and Safari, what a tagging server costs and what to move first.

11 min read

Key takeaways

  • Server-side tracking means two different things: a tagging server that receives your browser's hits and forwards them to vendors, and events your own backend sends straight to an analytics or ad platform. Most teams need the second one first.
  • Purchases, refunds, renewals and CRM lead stages belong on the server, because the system that confirms the money sees every one of them. Page views and on-page behaviour stay in the browser.
  • A tagging server only gets durable first-party cookies if it runs on your own domain; on the cloud provider's default domain it runs in a third-party context and can only set JavaScript cookies.
  • Google's Cloud Run guide puts each tagging server at about $45 a month and recommends at least 2, so a production setup starts near $90 a month before scaling, monitoring and someone to maintain it.
  • Moving collection to a server changes neither what you need consent for nor the risk of counting one order twice. Pick one path per event, or deduplicate with a shared event ID.

Server-side tracking means sending analytics and conversion events from a server you control rather than relying only on a script in the visitor’s browser. It fixes the events browsers lose most often: purchases confirmed after a payment-gateway redirect, refunds and renewals that never touch a page, and hits blocked by ad blockers or cut short by Safari’s cookie limits. It does not replace your browser tag, and it costs real money and upkeep if you run a tagging server. This guide separates the two kinds of server-side tracking, shows what each fixes and costs, and gives an order for what to move first.

Server-side tracking is collecting analytics or conversion events on a server you control, either by routing browser hits through your own tagging server or by sending events directly from your backend, instead of sending everything from the visitor’s browser to each vendor.

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

Client-side tracking runs scripts in the visitor’s browser, and each script sends data straight to its vendor: your analytics tool, the Meta Pixel, the Google Ads tag. Server-side tracking puts a server you control in the path. People use the term for two different setups, and mixing them up is the most common reason a server-side project runs over budget without fixing the original problem.

Browser tag (client-side) Tagging server (e.g. GTM server container) Server-to-server events from your backend
Where the event starts Visitor’s browser Visitor’s browser, then your tagging server Your shop, payment callback or CRM
Who forwards it to vendors Each vendor’s script Your tagging server Your code, through each vendor’s API
Sees page views and clicks Yes Yes, if the browser sends them No
Sees payments after a gateway redirect, refunds, renewals Only if the visitor returns to a page Same as the browser Yes, every one
Affected by ad blockers and closed tabs Yes Partly, because the first hop is still the browser No
Running cost None beyond the tool Hosting plus maintenance Development time

Google describes the tagging-server model as “processing data on a server you control, rather than in the user’s browser.” The server container uses clients that turn incoming browser requests into events, then tags that send those events on (Google Tag Platform). The backend model is older and simpler: when your payment provider confirms an order, your code sends a purchase event to the analytics tool and the ad platforms. Meta’s Conversions API, the GA4 Measurement Protocol and the AdPix server-to-server API all work this way.

What does server-side tracking fix?

It fixes lost conversions, short-lived cookies and how much data third-party scripts collect, in that order of value for most shops.

Lost purchases. A customer who pays, then closes the tab before the gateway redirects back, never loads your thank-you page, so a browser purchase tag never fires. The payment callback reaches your server anyway. This is the single biggest reason to start, and it only needs backend events, not a tagging server. The conversion tracking guide explains why the system that confirms the money should report it.

Cookie lifetime in Safari. WebKit’s documentation says Safari’s Intelligent Tracking Prevention deletes all cookies created in JavaScript, and other script-writeable storage, after 7 days without user interaction, and caps cookies set in responses from third-party CNAME-cloaked or IP-cloaked servers to 7 days (WebKit). A tagging server on your own domain can set cookies in its HTTP response instead of in JavaScript. Google’s custom-domain page is explicit about the condition: on the cloud provider’s default domain, the server “runs in a third-party context” and can only set JavaScript cookies; on your own subdomain or, better, on a path of your main domain, you get the “security and durability benefits” (Google Tag Platform). The first-party data guide covers what else changed in browsers.

Control over what vendors receive. Google’s server-side course says that in the server container you can “validate, parse, anonymize, or even block” requests before they go to marketing partners, and that the vendor then sees a request from your server instead of the user’s browser and IP address (Google Tag Platform).

Page weight. The same course says the browser does less work because “only a single stream of data” goes to the server container, so fewer vendor libraries load on the page. How much faster your site gets depends on how many tags you remove; Google gives no figure.

What does server-side tracking not fix?

It does not fix consent, double counting or a tracking plan that was wrong to begin with. Four limits catch teams out:

  1. Consent still applies. Moving collection to a server changes where data is processed, not what you collect about a person or why. If an event needed consent in the browser, it still needs it; the cookie consent guide covers how consent choices shrink your numbers and how to size the gap. A server can only honour a choice it can see: AdPix cookie consent writes the accepted categories onto every event row, so whatever path an event takes, its consent travels with it.
  2. The browser is still the first hop for a tagging server. Ad blockers generally work from filter lists of known tracking domains and script paths. A tagging server on your own domain is less likely to be on a list, but it still needs the browser to send the hit, and a blocker can add your endpoint. Only events your backend sends on its own are out of the browser’s reach.
  3. Server events have no page or session. The backend does not know which page the visitor was on or how long they stayed. Google says Measurement Protocol events need tagging alongside them and that sending events “solely with the Measurement Protocol” gives “only partial reporting” (Google Analytics).
  4. Two paths can double your revenue. If the browser and the server both report the same order and the tool does not deduplicate across them, you count it twice. That needs a decision per event, covered below.

How much does server-side tagging cost?

Server-to-server events cost development time and nothing more, because they run on servers you already have. A tagging server is a new piece of infrastructure. Google’s Cloud Run setup guide says each server “costs approximately $45 /month (USD)” with 1 vCPU and 0.5 GB of memory on CPU-always-allocated pricing, recommends “a minimum of 2 instances to reduce the risk of data loss,” and expects autoscaling from 2 to 10 servers to handle roughly 35 to 350 requests per second, depending on how many tags run (Google Tag Platform).

The arithmetic for a budget line:

  • Minimum production setup: 2 servers × $45 = about $90 a month.
  • Worst case at the guide’s example ceiling of 10 servers: 10 × $45 = about $450 a month, which is what the max-instances setting caps.
  • Not in that number: logging and monitoring, the custom-domain or load-balancer setup, a preview server, and the hours of whoever updates the container when a vendor changes its tag.

Google’s intro page says you can run the tagging server on Google Cloud “or a platform of your choice.” For a business in Iran, that choice matters: whether you can open and pay for a Google Cloud account at all is a risk to check before you plan on it, and the guide to Google Analytics risks in Iran lists what Google’s own pages say about Iranian users.

What should you move server-side first?

Move events in order of the money they carry and how often the browser loses them. For most online businesses that order is:

  1. Purchases, sent from the payment callback with your order ID, because closed tabs and gateway redirects lose them in the browser.
  2. Refunds, renewals and recurring invoices, which never happen on a page at all.
  3. Lead stages from your CRM (qualified, won, lost), so cost per qualified lead is measurable; the event tracking guide gives the event names.
  4. Ad-platform conversions such as Meta’s Conversions API, with a shared event ID so the platform can deduplicate them against the Pixel.
  5. Only then, a tagging server for the remaining browser tags, if page weight, cookie lifetime or vendor data control is a measured problem for you.

Page views, scrolls, clicks and add-to-cart events stay in the browser. The server cannot see them, and moving them through a tagging server is step 5, not step 1.

Worked example: what lost purchases do to ROAS

Say a shop (hypothetical) spends $20,000 a month on ads, has an average order value of $60, and its database shows 1,000 paid orders from those campaigns this month. The browser tag recorded 860 purchases, because 140 customers paid and closed the tab before the redirect.

  • ROAS from the database: (1,000 × $60) ÷ $20,000 = $60,000 ÷ $20,000 = 3.0
  • ROAS from the browser tag: (860 × $60) ÷ $20,000 = $51,600 ÷ $20,000 = 2.58

If this shop’s break-even ROAS is 2.8, the browser numbers say the campaigns lose money and the database says they make it. Nothing about the ads changed; 14% of purchases were simply never reported. Sending the purchase from the payment callback closes that gap without any tagging server. The ROAS formula guide shows how to work out your own break-even point.

ROAS calculatorReturn on ad spend and your break-even point.Try it free

How do you avoid double counting with server-side tracking?

Give each event one path, or give both paths the same event ID and use a tool that matches them. Each platform handles this differently:

  • Meta recommends running the Conversions API “alongside” the Pixel, which it calls a “redundant setup,” and requires a deduplication method. Events are matched when the Pixel’s eventID equals the server’s event_id and the event names match, and only if they arrive within 48 hours of the first event with that ID (Meta for Developers). Create the ID once, when the order is created, and pass it to both.
  • GA4 joins Measurement Protocol events to browser activity through client_id, and its generate-event and rename rules do not apply to events sent that way, so your server must send the final event name itself (Google Analytics).
  • AdPix writes browser and server events to the same table with different IDs, so its docs say to send each event down one path only: a purchase sent from both becomes two orders (AdPix Docs).

A quick monthly check catches most mistakes: compare purchases in each tool against paid orders in your database. A ratio near 2.0 means an order is being sent twice; a ratio well below 1.0 means the browser is still the only path.

How does server-side tracking work in AdPix?

AdPix accepts server events through its server-to-server API, and its docs recommend it for gateway-confirmed purchases, renewals, recurring invoices, refunds, operator-entered orders and events lost to ad blockers, while page views and engagement stay with the browser tag (AdPix Docs). How it behaves:

  • Keys. You create a server key (it starts with sk_) under Admin → Website settings → Integrations, tied to one website and data stream, with only the scopes you need. The secret is shown once. The public AP- tag ID is not accepted on this path. HMAC request signing is optional per key.
  • Only two required fields. Each event needs event and event_id; value and currency carry revenue and items builds order lines.
  • Safe retries. Re-sending the same event_id with the same body writes nothing new; the same ID with a different body is rejected with a conflict. The docs say this is the only collection path in AdPix with that guarantee.
  • Attribution is frozen per order. An event with an order_id gets an attribution snapshot (channel, source, campaign, first and last touch) written once, using last non-direct touch. Sending the browser’s anonymous_id ties the order to the campaign that brought the visitor.
  • No session, no page. Server events count in event totals, key events, revenue and user attribution, but not in session-based metrics or page reports, and event rules do not run on them.
  • Batches take up to 500 events per request, and a /verify call checks the key before you go live.

The docs do not name a plan for server keys. The pricing page lists API access from Starter up and no API access on Free, so check AdPix pricing for whether your plan includes the server endpoint. E-commerce reports, including sales and ROAS by channel, are on every plan, and the e-commerce events docs show the same purchase sent from the browser and the server.

AdPix is a web analytics platform that replaces Google Analytics 4: realtime, acquisition, engagement, conversion and e-commerce reports, plus attribution, lift testing and marketing mix modelling, with no data sampling and a free plan. It runs alongside GA4, so you can send server purchases to both and compare them against your orders, as the GA4 side-by-side guide describes. If the browser tag is not installed yet, start with the AdPix install guide; for where server events fit among UTMs, events and key events, see the website tracking guide.

Your next step: pull last month’s paid orders from your database, compare them with purchases in your analytics tool, and if more than a few percent are missing, move the purchase event to your payment callback before you spend anything on a tagging server.

ROAS calculator

Return on ad spend and your break-even point. The free plan covers 100,000 page views a month for each website, no credit card. Setup takes under five minutes.

Frequently asked questions

What is server-side tracking?

Server-side tracking is collecting analytics or conversion events on a server you control instead of only in the visitor's browser. It covers both a tagging server, such as a Google Tag Manager server container, that receives browser hits and forwards them to vendors, and events your own backend sends directly to an analytics tool or ad platform, such as a purchase confirmed by the payment gateway.

Is server-side tracking better than client-side tracking?

Neither replaces the other. The browser is the only source for page views, scrolls and clicks, while the server is the reliable source for events that happen off the page, such as payment confirmations, refunds and renewals. Google says its GA4 Measurement Protocol is meant to supplement tag-based collection, not replace it.

Does server-side tracking bypass ad blockers?

Events your backend sends from its own systems, such as a purchase from the payment callback, never pass through the browser, so an ad blocker cannot stop them. A tagging server still depends on the browser sending it a request first, so whether those hits get through depends on the blocker and its filter lists.

How much does server-side tagging cost?

Google's Cloud Run setup guide says each tagging server costs about $45 a month (1 vCPU, 0.5 GB memory, CPU always allocated) and recommends running at least 2 to reduce the risk of data loss, with autoscaling from 2 to 10 servers handling roughly 35 to 350 requests per second. Add the time of whoever maintains the container.

Do I still need cookie consent with server-side tracking?

Yes. Moving collection to a server changes where data is processed, not what you collect about a person or why. If a browser event needed consent before, it still does, and a server event that carries an email, phone number or user ID is personal data you need a legal basis for.

Sources and methodology

Server-side tagging behaviour, the custom-domain options and the Cloud Run cost and scaling figures come from Google's Tag Platform pages; the Measurement Protocol rules from Google Analytics developer docs; Meta's redundant setup and 48-hour deduplication from Meta for Developers; Safari's cookie limits from WebKit's tracking-prevention page; AdPix server-side behaviour from the AdPix docs (server-side tracking, updated 19 October 2026; e-commerce events, updated 3 August 2026). All were opened on 17 November 2026. AdPix plan placement comes from adpix.io/pricing (read on 13 November 2026). The shop in the worked example and all its figures are hypothetical.

  1. Google Tag Platform: An introduction to server-side tagging
  2. Google Tag Platform: Server-side tagging fundamentals, why and when to use it
  3. Google Tag Platform: Custom domain configuration
  4. Google Tag Platform: Cloud Run setup guide
  5. Google Analytics: Measurement Protocol (GA4)
  6. Meta for Developers: Handling duplicate Pixel and Conversions API events
  7. WebKit: Tracking Prevention in WebKit
  8. AdPix Docs: Server-side tracking
  9. AdPix Docs: E-commerce events

This article was drafted with AI assistance and reviewed by the AdPix team before publishing. Editorial policy

About the authorFounder, AdPix · Builder of AdPix

Founder of AdPix, the web analytics platform built for Iranian teams. Every article on this blog is reviewed by the founder before it is published.

Web analyticsAttributionCampaign measurement

Analyze your data, decide with more confidence

With AdPix, analyze campaign performance and grow in step with your business needs.