Tracking

What is server-side tracking? A guide for webshops

Server-side tracking sends purchases from your order data to ad platforms. See how it works, what it sends, how deduplication works and what it cannot fix.

·Updated ·11 min read·By the ROASaurus team

Key takeaways
  • Server-side tracking sends conversion events, such as purchases, from a server to the ad platform API instead of only from a pixel in the browser.
  • When the purchase is sent from the order data of your shop, ad blockers and a thank-you page that never loads no longer cause lost sales.
  • The browser is still needed to save the click id on landing, and the pixel can run next to the server with the same event_id so each purchase counts once.
  • Server-side tagging, such as a Google Tag Manager server container, still starts from browser events, so it cannot recover purchases the browser never sent.
  • Server-side tracking is not a way around consent: privacy rules apply to the data whichever route it takes.

Server-side tracking means that conversion events, such as a purchase, are sent to ad platforms from a server instead of only from a script in the shopper's browser. For a webshop, the server sends each order to Meta, TikTok or Google through their APIs, so the sale is reported even when the browser pixel is blocked or never loads.

This guide explains the difference between a browser pixel and server-side tracking, follows the data from the ad click to the ad platform, and shows what a server event contains. It also covers deduplication, server-side tagging, consent and how to tell whether your store needs it. For the Shopify setup itself, read server-side tracking on Shopify.

Browser pixel vs server-side tracking

A browser pixel is a piece of JavaScript from the ad platform. It runs on your pages and sends events from the shopper's device straight to the platform: a page view, an add to cart, a purchase on the thank-you page. It works only when the script loads, runs and reaches the platform before the shopper leaves the page.

Server-side tracking moves the sending to a server. The event can start from data your shop already has, such as a paid order, and the server posts it to the platform's API. Meta calls this API the Conversions API and TikTok calls it the Events API. Google Ads uses enhanced conversions, which add hashed customer data to a conversion.

Browser pixel
  • Runs in the shopper's browser
  • Sends events directly to the ad platform
  • Sets and reads first-party cookies, such as _fbp for Meta
  • Sends nothing when the script is blocked or the page does not load
Server-side tracking
  • Runs on a server that you or a service provider control
  • Sends events to the platform's API
  • Can start from the order record in your shop
  • Does not depend on the thank-you page loading
The two methods work together. Most stores run both and let the platform remove the duplicates.

Running both gives the platform the most complete data. The browser event adds cookies and page context. The server event arrives even when the browser fails. A shared event id makes sure the platform counts each purchase once.

How does server-side tracking work?

Server-side tracking for a webshop has two halves. The first half happens in the browser: when a shopper lands from an ad, a script saves the click id from the URL. The second half happens on the server: when the order is paid, the server links that click id to the order and sends the purchase.

Ad clickThe platform adds a click id to the URL, such as fbclid, ttclid or gclid.
Landing pageA first-party script saves the click id and UTMs with a visitor id.
Order paidThe shop records the order and tells the server, for example with a webhook.
ServerMatches the order to the visitor, hashes customer data and builds the event.
Ad platform APIReceives the purchase and matches it to the ad click.
The purchase starts from the order record, not from the thank-you page. Only the click id has to be saved in the browser.

Capturing the click

Ad platforms add a click id to the landing URL: fbclid for Meta, ttclid for TikTok, gclid for Google Ads and msclkid for Microsoft Ads. The click id is the strongest link between a sale and the ad that caused it, so it must be saved on the first page view. UTM parameters add the campaign, ad set and ad names in a format you control.

Matching the order

The server then needs to know which visitor placed the order. The most reliable link is a value that travels with the cart into the order, such as a visitor id saved on the cart. Other methods are weaker: an email address the visitor entered earlier on the site, or the same IP address and browser seen shortly before the order. Each webshop platform offers different options. Our guide for other webshops lists the methods ROASaurus uses per platform.

Sending the event

Finally, the server posts the purchase to each platform's API. The event includes the order value, the click id and customer data that helps the platform find the person who clicked. If a platform is down or returns an error, a good setup tries again later, so the purchase is not lost.

What does a server event contain?

Every platform has its own field names, but a purchase event carries the same kinds of data everywhere. Here is a shortened example for the Meta Conversions API:

Example: a Purchase event for the Meta Conversions API
{
  "data": [{
    "event_name": "Purchase",
    "event_time": 1793009700,
    "event_id": "order-1042",
    "action_source": "website",
    "event_source_url": "https://yourstore.com/checkout/thank-you",
    "user_data": {
      "em": ["8c87b489ce35cf2e2f39f80e282cb2e804932a56a213983eeeb428407d43b52d"],
      "ph": ["6d420c869d4eb97fe7de4576c9d04bb34d1a5788e0b3a657f61d7be020d8ead0"],
      "client_ip_address": "203.0.113.24",
      "client_user_agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X) ...",
      "fbc": "fb.1.1792832531000.IwAR2xExampleClickId",
      "fbp": "fb.1.1792832529000.1234567890"
    },
    "custom_data": { "currency": "USD", "value": 84.00 }
  }]
}
FieldWhat it isHashed?
Event name and timePurchase, and when the order was placedNo
Value and currencyThe order value that the platform uses for ROAS and value-based biddingNo
event_idA unique id per event, the same in the browser and on the server, for deduplicationNo
Email, phone, name, addressCustomer data from the order, normalized and hashed with SHA-256Yes
Click id (fbc, ttclid, gclid)The id from the ad click, saved when the shopper landedNo
IP address and user agentHelp the platform match the event to a deviceNo
Customer data is hashed before it leaves your server. Meta requires the IP address, user agent and click ids to be sent without hashing.

Hashing turns an email address into a fixed string of characters. The same address always gives the same string, but the string does not show the address. The platform uses the hashed values only to look for a match among its own users. This is how a purchase can be matched to the person who saw or clicked the ad, even when that person's browser blocked the pixel.

How does deduplication work?

When the pixel and the server both send the same purchase, the platform must count it once. Both copies carry the same event name and the same event id, for example order-1042. Meta compares the pair and keeps one copy, as long as the second copy arrives within 48 hours of the first.

Purchase event_id=order-1042 browserReceived from the pixel
Purchase event_id=order-1042 serverSame name and id: counted once
Purchase event_id=order-1043 serverThe pixel was blocked: the server copy is the only one
Purchase event_id=1044 serverThe browser sent order-1044: the ids differ, so it counts twice
Deduplication only works when both copies use exactly the same event id.

Most double counting comes from two senders that do not share ids. A typical case is a platform's own shop app and a separate tracking tool that both send purchases with their own ids. Our help article on preventing double counting lists the usual causes and fixes.

Server-side tagging vs sending from order data

The term server-side tracking is used for two different setups. Both send events from a server, but they start in different places.

Server-side tagging, such as Google Tag Manager server containers

With server-side tagging, the browser sends its events to your own server instead of to each vendor. The Google Tag Manager server container is a well-known example. It runs in your own Google Cloud project or in another environment you choose. It receives requests from the browser, and its tags forward the data to Google Analytics, Meta and other vendors. You decide what data goes where, and the server can run on a subdomain of your site.

The events still start in the browser. If the tag in the browser is blocked, or the thank-you page never loads, the server container has nothing to forward. You also run, pay for and update the server yourself.

Sending from order data

The second approach starts the purchase from the order record in your shop. The shop reports the paid order to the server through a webhook or an API, and the server sends it to every connected platform. The browser is only needed earlier, to save the click id when the shopper lands.

Server-side taggingSending from order data
Where the purchase startsA tag in the browserThe paid order in your shop
Thank-you page closed earlyPurchase lostPurchase sent
Tag blocked in the browserPurchase lost, unless the first-party endpoint gets throughPurchase sent
Cash on delivery and external payment pagesDepends on the thank-you pageSent when the order is created or paid
Browsing events (page views, add to cart)YesNeeds a separate browser collector
Who runs the serverYou: hosting and updatesYou or a service provider
Server-side tagging improves how browser events are delivered. Sending from order data makes the purchase independent of the browser.

The two approaches can be combined. Many stores collect page views and add-to-cart events in the browser, and send the purchase from order data. The purchase is the event that ad platforms use to report ROAS and to optimize bidding, so it is the one that most needs to be complete.

What does server-side tracking fix, and what does it not fix?

It fixes
  • Purchases lost because an ad blocker stopped the pixel
  • Purchases lost because the thank-you page did not load
  • Purchases from payment methods that finish outside your site
  • Weak matching, by adding hashed customer data to each event
It does not fix
  • Consent: a visitor who declined is still a visitor who declined
  • Different attribution windows and models per platform
  • Duplicate senders that use different event ids
  • Click ids that were never saved on landing
Server-side tracking makes the data more complete. It does not change the rules that apply to the data.

Consent still applies

Server-side tracking is a way of delivering data, not a way around privacy rules. Where the law requires consent for marketing cookies or tracking, that requirement covers the data you collect, whichever route it takes to the platform. Moving a tracker to your server does not change what a visitor agreed to.

Attribution stays platform-specific

Each platform still credits purchases with its own windows and rules. Server events give every platform better data, but the totals across Meta, TikTok and Google can still add up to more than your shop's revenue. To compare channels with one set of rules, use one attribution model across all of them, such as the models in ROASaurus attribution.

Does your store need server-side tracking?

A store that spends a meaningful budget on paid social or search ads usually benefits. The case is strongest when several of these points are true:

  • The ad platform receives clearly fewer purchase events than your shop has web orders. Our guide to ad blockers and tracking shows how to measure this gap.
  • Many of your visitors use Safari on iPhone or Mac, where cookies set by scripts last 7 days at most. See Safari ITP and ad tracking.
  • Shoppers often buy days after the first ad click.
  • Payment finishes outside your site, or orders are paid later, as with cash on delivery or bank transfer.
  • You optimize campaigns for purchases or purchase value, so the platform needs every sale to learn from.

Here is how a gap changes decisions in practice. An example store has 1,000 web orders in a month. Its Meta pixel reported 820 Purchase events, so 18% of orders never reached Meta from the browser.

Example store: purchases that reached Meta in one month
Web orders in the shop
1,000
Pixel only
820
Pixel + server, deduplicated
1,000
In this example, the pixel alone misses 180 of 1,000 orders. Sending purchases from order data closes the gap.

The store's break-even ROAS is 2.5, and Ads Manager shows a ROAS of 2.3 on pixel data. On those numbers the campaigns lose money. If ad-driven orders were missed at the same 18% rate, the real ROAS is about 2.3 ÷ 0.82 = 2.8, which is above break-even. That is an upper estimate, because not every missing order came from an ad. It still shows how a tracking gap can make a profitable campaign look like a loss.

Server-side tracking matters less for a store that does not advertise, or that spends very little on ads.

How ROASaurus sends server-side events

ROASaurus captures 19 click ids and six UTM fields on landing and stores them with a first-party visitor id. It sends each purchase from your shop's paid orders to Meta, TikTok, Snapchat, Pinterest, Reddit, X, Microsoft Ads, Taboola, LinkedIn, OpenAI Ads, Spotify, AppLovin, Criteo, AdRoll and Outbrain. On Shopify, Google Ads conversions are sent from the Shopify checkout. Browser pixels can run next to the server events with the same event id, and Meta, TikTok, Snapchat, Pinterest, Reddit, OpenAI Ads, AppLovin and Spotify deduplicate them. Every delivery and the platform's response are listed in the Event log.

Read more on the server-side tracking page, or find your webshop on the integrations page.

Sources

  1. Meta for Developers: Conversions API
  2. Meta for Developers: Handling Duplicate Pixel and Conversions API Events
  3. Meta for Developers: Customer Information Parameters
  4. Google for Developers: An introduction to server-side tagging
  5. Google Ads Help: About enhanced conversions

In ROASaurus

Keep reading

TrackingAd blockers and tracking: what your store losesAd blockers stop tracking pixels, so ad platforms miss purchases. See which events are lost, why server-side events are not, and how to measure your gap.TrackingConsent Mode v2 and GDPR: what a webshop may sendConsent Mode v2 for webshops: the four Google consent signals, what EU law asks, and what server-side tracking may still send. General information only.TrackingDuplicate purchase events: why sales are counted twiceDuplicate purchase events inflate conversions and ROAS. See the causes, how Meta, TikTok, Snapchat, Pinterest and Reddit deduplicate, and how to fix it.
FAQ

Questions, answered

Is server-side tracking better than a browser pixel?

It is more complete for purchases, but it works best together with the pixel. The pixel adds browser cookies and page context, the server adds the orders the browser missed, and a shared event id keeps one copy of each purchase.

Does server-side tracking work with ad blockers?

Purchases sent from order data are not affected, because the shopper's browser does not send them. The click id still has to be saved in the browser on landing, and first-party collection makes that more reliable.

Is server-side tracking GDPR compliant?

Server-side tracking is a delivery method, not a legal basis. Consent rules apply to the data whichever route it takes, so follow the visitor's choice and ask your legal advisor which data you may send.

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

Server-side tagging forwards browser events through your own server, for example a Google Tag Manager server container. Server-side tracking from order data starts the purchase from the order in your shop, so the purchase does not depend on the browser.

Do I need a developer to set up server-side tracking?

Not when you use a service that connects to your shop and ad platforms through apps and logins. A self-hosted tag server needs someone to set it up, host it and keep it updated.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. 14-day free trial, no credit card.

Start your free trial →