Skip to main content

Server-side tracking for Shopify

Server-side tracking for Shopify consolidates your measurement in Customer Events and forwards purchases to GA4, Meta and Google Ads from the server rather than the browser. I have built webshops and fixed their tracking across 400+ projects, and I set it up directly in your store, without apps that lock you in.

  • I usually reply the same day
  • Written estimate before work starts
Mikkel Tschentscher

star reviews

Read every review
  • Lightning fast with an eye for detail

    Mikkel is a man after my own heart. Executes at lightning speed, has an eye for detail and is always there when you need him. It does not get better than that.

    Tini Owild(translated from Danish)
  • Dedicated and capable like no one else

    I have never come across a developer as dedicated and capable as Mikkel.

    Jonas Krogslund(translated from Danish)
  • Helpful and lightning fast to reply

    Mikkel is seriously good, helpful, lightning fast to reply, and on top of that he is a nice person. I can warmly recommend Mikkel to others..

    Trine Handskemager(translated from Danish)

Server-side tracking for Shopify

Clean up before you build

A typical Shopify store measures the same purchase in three or four places: Shopify's own pixel, a tracking app, a snippet in the theme and perhaps a Google tag from a previous agency. The purchase numbers therefore match nothing, and nobody can say why. Setups like that measure the wrong thing with great confidence; the numbers look credible right up until you hold them against the order list.

So I always begin with a cleanup. I go through what each source contributes, remove the duplicates and leave one place events come from. That exercise alone often makes the numbers make sense again.

What I set up in the store

  • Shopify Customer Events as the single source of events, across storefront and checkout.
  • Server-side GTM on your own subdomain, with Shopify's order data as the foundation.
  • GA4 purchase events with the right product fields, so the reports are usable in practice.
  • Meta Conversions API and Google Ads conversions with deduplication keyed on order ID.
  • Consent Mode v2 and the cookie banner wired together, so consent governs what gets sent.
  • Refunds and cancelled orders forwarded, so the platforms do not optimise on revenue that never materialised.

How Shopify's events translate to GA4 and Meta

Shopify, GA4 and Meta each use their own names for the same thing. The mapping between them, often called event mapping, is therefore a fixed part of any Shopify setup, and it is where many errors arise. In practice Customer Events works as the store's data layer, and each standard event has to be translated into the event the platform expects, with the right fields for product, price, quantity and currency.

  • product_viewed becomes view_item in GA4 and ViewContent for Meta.
  • collection_viewed becomes view_item_list in GA4, so collection pages can be measured.
  • search_submitted becomes search in GA4 and Search for Meta.
  • product_added_to_cart becomes add_to_cart in GA4 and AddToCart for Meta.
  • checkout_started becomes begin_checkout in GA4 and InitiateCheckout for Meta.
  • payment_info_submitted becomes add_payment_info in GA4 and AddPaymentInfo for Meta.
  • checkout_completed becomes purchase in GA4 and Purchase for Meta, with order ID, value and currency.
  • Product IDs have to match the ones in your product feed, otherwise dynamic remarketing will not work.

Reconciled against Shopify's own numbers

Once the setup is running, I spend a period holding Shopify's orders up against GA4 and the ad platforms. The purpose is to know the deviations and be able to explain them, so you dare use the numbers to allocate budget.

You get the reconciliation as a spreadsheet along with documentation of the whole setup. That gives you a reference point to measure against, and it becomes visible if something breaks after a theme or app update.

What is server-side tracking for Shopify?

Server-side tracking for Shopify is a setup where the store's measurement events are captured via Shopify's Customer Events and sent through a server-side GTM container to GA4, Meta and Google Ads. Instead of every platform having its own script in the theme, all data comes from one place, and your server decides what gets forwarded.

The need arose because Shopify has tightened up heavily around checkout. You can no longer place scripts on the thank-you page, and the old approaches to purchase tracking have been phased out. At the same time, browser measurement in general struggles with cookie restrictions and ad blockers. Many stores therefore have gaps in precisely the last and most important step of the buying journey, without anyone noticing.

If you run a Shopify store advertising on Meta or Google, this is relevant to you. The algorithms optimise on the conversions they can see; the more complete your purchase data, the better the platforms can work for your budget. Stores with multiple markets and currencies typically have the most to fix, because currency handling is often configured wrong.

My approach is to clean up the existing tracking first, build the Customer Events setup as the single source, and connect server-side GTM, Meta CAPI and Google Ads with deduplication. Consent Mode v2 and your cookie banner get wired together so consent is respected, and finally the numbers are reconciled against Shopify's own reporting.

Channel apps, a tracking app or your own setup?

There are three realistic routes to tracking in a Shopify store. The first goes through the official channel apps from Google and Meta, which connect the store to Google Ads and Meta in a few clicks. Meta's channel can also send events via the Conversions API. For a smaller store with a modest ad budget that can be a fine place to start, as long as you know what is being sent and do not have other apps measuring the same thing at the same time.

The second route is a paid tracking app that sets up server-side tracking for you. It is quick, but you are tied to the app's choice of events and fields, it can be hard to see exactly what is sent, and if you uninstall the app, the measurement goes with it. Stacking several apps on top of each other is also a classic reason the same purchase gets counted more than once.

The third route is your own setup with Customer Events, a custom pixel and a server container in Google Tag Manager. It takes longer to build, but you decide the events, fields and consent logic yourselves, everything can be documented, and nothing disappears because a subscription is cancelled. That is the route I typically recommend once the ad budget is large enough for precise purchase data to matter, or when the store runs several markets.

Order data as a source: webhooks

The most reliable source of a purchase in Shopify is not the browser but the order itself. Shopify can send a webhook, a server-to-server message, the moment an order is created, and it arrives whether the customer closes the window after paying, is sent on to a payment provider and never comes back, or runs an ad blocker. That is why the order webhook makes a good backup for the purchase event from Customer Events, so the purchase still reaches the server container when the browser fails.

The webhook does need some thought, though. It does not know by itself what the customer answered in the cookie banner, so the setup has to be able to link the order to the consent before anything is forwarded to the ad platforms. It also fires for orders from other sales channels, such as in-store sales via POS or orders created manually in admin, so it has to be filtered on the order's source. And refunds and cancellations have their own webhooks, which can pass the corrections on.

When a purchase can arrive both from the browser and from the webhook, the platforms have to be able to see it is the same purchase. That is handled by deduplication: both copies get the same ID, typically the order ID, which Meta uses as the event ID and Google Ads as the transaction ID. In GA4 the purchase should come from one source only, and if it comes from the webhook, the visit's client ID has to travel with it, otherwise GA4 cannot tie the purchase to the channel the customer came from.

Shopify server-side tracking across Denmark

Shopify stores are spread across the whole country, and so are my clients. I work from Glostrup in Greater Copenhagen and help webshops in Copenhagen, Aarhus, Odense, Aalborg and everywhere in between; the entire setup lives in Shopify admin and Google Tag Manager, so physical distance means nothing.

In practice the collaboration works by giving me access to the store as staff or collaborator, and by taking the important decisions over a video call with screen sharing. Stores in the capital area are welcome to meet in person, but most choose the digital route purely to save time.

A typical job starts with you sending me a link to the store and telling me which platforms you advertise on. I then review your current tracking and come back with a concrete quote. You communicate directly with me throughout, and because I am a freelancer rather than an agency, there are no middlemen and no running subscription; the setup is yours, documented and free of lock-in.

Why the numbers never fully match

A realistic goal for Shopify tracking is not identical numbers across platforms. Shopify counts an order the moment it is created. GA4 counts a purchase in a session it can tie to a user. Meta attributes the purchase to an ad someone saw days earlier. Three different questions give three different answers, and that will remain the case.

The realistic goal is that the differences are known and stable. If GA4 sits consistently a touch below Shopify, you can trust the numbers and work with them. If instead the deviation jumps around from month to month, something is wrong in the setup, and it needs finding.

That is why I always finish with a reconciliation where one period is laid out side by side: Shopify's orders, GA4's purchases and the platforms' conversions, with an explanation for every gap. It gives you a baseline, and it gives the next person touching the setup something to check their work against.

What you get

Concrete deliverables, not a report of recommendations someone else has to find time for.

  • One source of events

    Customer Events as the only place events originate, so there is one place to debug when something looks off.

  • Old tracking cleaned out

    Pixels, apps and theme snippets measuring the same purchase get mapped and cut down to a single truth.

  • Refunds passed along

    Cancelled and refunded orders reach the ad platforms, so optimisation is built on real revenue.

  • Reconciliation and documentation

    A spreadsheet of orders against GA4 and the ad platforms plus a description of the setup, yours to keep.

View all cases

How it works

Four steps. You know what happens when, and you can stop after any of them.

  1. 01 / 04

    Audit of the current setup

    Using preview mode and the network log, I work out which tags fire, which fail, and where the same purchase gets counted more than once. The result is a concrete list of what has to go and what is missing.

  2. 02 / 04

    A new structure in GTM

    The container is rebuilt with consistent naming and a clean data layer, so anyone can open it a year from now and understand what happens. Old tags are archived rather than deleted, so nothing is lost.

  3. 03 / 04

    Server-side and consent mode

    I set up a server container on your own subdomain and wire in consent mode, so the consent choice controls what gets sent. Conversion tracking for Google Ads and Meta moves over with it.

  4. 04 / 04

    Checked against order data

    For a period after launch, I compare orders in your backend with the numbers in GA4 and the ad platforms. Deviations are explained in writing, so you know how much weight the numbers can carry.

Brands I've worked with

  • MT Højgaard Danmark
  • Egmont
  • NNIT
  • Visma
  • Lomax
  • Pascal
  • able.
  • OOONO
  • Novo Nordisk Fonden
  • Energii
  • Maersk Tankers
  • Nordkysten Entreprenørfirmaet

Frequently asked questions

What does server-side tracking for Shopify cost?

The price depends on the store. What drives it is mainly the amount of old tracking to clean up, the number of platforms to connect, and whether you run multiple markets and currencies. Send me a link to the store and I will review it briefly and come back with a concrete quote. You get a reply the same day.

What are Shopify Customer Events?

Customer Events is Shopify's official way to listen to events across storefront and checkout without touching the checkout code itself. It is the foundation of a modern Shopify tracking setup and exists on all plans.

What is event deduplication?

Deduplication means a platform recognises two copies of the same event and counts it only once. It is needed because, in a Shopify store with server-side tracking, a purchase is often sent both from Customer Events in the browser and from the server. The copies therefore have to carry a shared ID, such as the order ID, so the platform can see they belong together. Without it, Meta and Google Ads count the purchase twice, and their algorithms optimise on an inflated number.

Do you help Shopify stores outside Copenhagen?

Yes, all of Denmark. I am based in Glostrup near Copenhagen, but Shopify setups are built in admin and GTM, so I help stores in Aarhus, Odense, Aalborg and smaller towns over video calls and screen sharing.

Are we allowed to send customer data to Meta via the Conversions API?

Only for customers who have consented to marketing, and personal data such as email is sent in hashed form per the platforms' standard. Server-side does not make it legal to bypass consent; what it does is make it possible to control and document exactly what is sent. I am not a lawyer, but I make sure consent governs the data flow and that it is all written down.

Does it require Shopify Plus?

No. Customer Events exist on all Shopify plans. Plus gives you more scope to customise checkout itself, but the core server-side measurement can be set up on any plan.

Does server-side tracking make the Shopify store faster?

A little, but it is rarely the big win. When the platforms' scripts are replaced by one event to your own server and redundant tracking apps are removed, there is less to load in the browser. The big speed improvements in a Shopify store, however, typically come from the theme, the images and the number of apps. Server-side tracking should therefore be chosen for data quality, not for speed.

What happens to our current tracking apps?

I go through the list and assess what each app actually contributes. Some can stay, most turn out to be redundant once Customer Events is in place, and there is almost always at least one app that has just been running without anyone knowing why.

Does it work with Shopify Markets and multiple currencies?

Yes, but the currency has to travel with every event, and GA4 and the ad platforms have to be configured to understand it. That exact point is among the most frequent errors I find in multi-market stores, so I always test it separately.

How do you test that it works?

You test in several layers. Shopify's Customer Events run in a sandbox, so the browser side is best followed in the browser's developer tools, where you can see each event being sent. The server container in Google Tag Manager has a preview mode where you watch events come in and get forwarded. In GA4, DebugView shows test events immediately, and in Meta's Events Manager you can follow test events from both browser and server. Finally you place a few test orders and follow the real orders for a period, so the deviations become known.

Your next step

Get a quote for Server-side tracking for Shopify

Tell me about your project. I’ll get back to you with questions, options and a concrete next step.