Tracking & attribution engineeringClient work
Headless Store, Sales With No Source: Web + Server GTM Rebuild With Consent and Refunds
A web + server GTM rebuild for headless Shopify: identity that survives the storefront-to-checkout hop, dedup, refunds and US opt-out consent.
- For
- Headless Shopify brands
- Checked
The situation
- Shopify records the orders. Your reports cannot say which ad produced them.
- The storefront sits on your own domain and checkout runs on Shopify’s domain, and nothing carries the visitor across the hop.
- Purchases appear twice, or the ones that carried a source disappear and the rest arrive with no source at all.
- Refunds are never subtracted, so the revenue the ad platforms learn from is higher than the revenue you kept.
- Consent on a headless build is yours to handle, and there is no native cookie wall you can lean on.
What I build
I build measurement that survives the storefront-to-checkout hop on a headless store: the Google client id and the ad click id are carried onto the Shopify order, one producer reports each purchase, a server-side leg sends the events from a stable source, refunds are fetched and subtracted, and US opt-out consent (Global Privacy Control and a reachable opt-out link) is wired without a cookie wall. On a headless build, that identity bridge is the whole job — without it a sale and the visit that produced it are two unrelated strangers.
How it works
- Audit the containers through the live API. Export equals production, with no drift, before anything is touched.
- Bridge identity. The Google client id and the ad click id are written onto the order as cart attributes, and a checkout-side custom pixel reports with session context.
- One producer per destination. The old page-based purchase tags are retired and the duplicate producer is switched off, so two systems cannot report the same sale.
- Build the server leg. GA4 Measurement Protocol with a server-set first-party cookie, Meta CAPI and Bing, each with confirmed before/after evidence.
- Subtract refunds. Successful refunds are fetched from Shopify on a schedule and sent to analytics, recorded so none can be sent twice.
- Consent, then watch. A US opt-out package (GPC honoured before any tag loads, an opt-out link, no cookie wall) and a live report plus a daily monitor.
What you get
- Identity that survives the hop: the sale can be joined back to the click that produced it.
- One purchase event per order, not a duplicate pair from two owners.
- Refunds subtracted from GA4 and the ad platforms, so bidding learns from net revenue.
- US opt-out consent with no cookie wall — a paste-ready package for your developer.
- A live report and a daily monitor, so a break is visible the day it starts.
- A change record and a rollback for every live change.
Built with: GTM web and server, GA4 Measurement Protocol, Google Ads, Meta CAPI, Microsoft Ads (Bing), Shopify Customer Events and custom pixel, headless Shopify (Next.js), Cloudflare Workers
Done before, with dates and numbers
In the 29 days before the rebuild, 612 sales reached analytics and only 39 carried any session source at all — 6%. After the identity bridge and the new server leg, traceability read 76% on the settled-day reading of 2026-08-19; duplicate purchase reporting went from +100% to 0%, and refunds were subtracted for the first time.
- US headless-Shopify automotive-repair retailer · delivered Aug 2026. sales traceable to source 6% → 76%; duplicate purchase reporting +100% → 0%; refunds subtracted for the first time (211 in 90 days); Google-attributed sales per day 0.1 → 10.5. Read the case: 16 Days Before Shopify's Deadline: Rebuilding Measurement for a Headless Store
- Fixel Pixel · production. the server-side pipeline this rebuild can hand off to: one event mapping, a delivery receipt per event, and detectors for a dead connection, a dark store and a stalled delivery.
Rated 5 out of 5 on Upwork.
Super efficient and knowledgeable. He is one of the most thorough people I have ever hired in UpWork. His documentation is excellent.
What you can look at
A redrawn diagram of storefront → checkout → identity bridge → server leg → refunds, with a redacted excerpt of a before/after event table. The diagram and table are rebuilt on synthetic data for this page; the figures below are live reads.
Client details anonymised. Figures read from live platform APIs in August 2026. I am the founder of Fixel Pixel, the server-side pipeline named here as one option.
What it costs and how it runs
A rebuild like this is scoped and quoted in writing as a Custom Engineering Project, from USD 1,500. If the cause or scope is not clear yet, the honest first step is a read-only Tracking Health Check (USD 395) or a Working Session (USD 195) on one question. A smaller, bounded piece can start at the Focused Fix minimum of USD 450. In the dated case the build was timed to beat a platform deadline: the new purchase leg went live on 2026-08-10, sixteen days before Shopify’s 2026-08-26 cutoff.
- Price
- Custom Engineering Project from USD 1,500, quoted by agreed scope. If the cause or scope is not yet clear, start with a Tracking Health Check (USD 395) or a Working Session (USD 195); a smaller bounded piece can be a Focused Fix from USD 450.
- Timeline
- Scoped and quoted in writing before the build. In the dated case the new purchase leg went live on 2026-08-10, sixteen days before Shopify's 2026-08-26 checkout-scripts cutoff.
When you don’t need this
If your storefront and checkout already share one visitor identity and your refunds are already net, a rebuild adds work you don’t need — I’ll say so. And if the gap is only attribution modelling (view-through and different attribution windows), no capture fix will move it; a reconciliation will show you that instead.
What people ask about this
My storefront is headless with a custom checkout. Can this still work?
Yes. The identity bridge runs through a checkout-side custom pixel and the Shopify order, so it does not depend on the theme or the native checkout scripts.
Do you need to rewrite my theme?
No. The storefront half is handed to your developer as a paste-ready patch package; the rest runs through supported paths.
Can you subtract refunds without a webhook?
Yes. Successful refunds are fetched from Shopify on a schedule and sent to analytics, checked against Google's validation service and recorded so none is sent twice.
What consent model is right for a US store?
Opt-out, not opt-in: GPC honoured before any tag loads and an opt-out link, with no cookie wall. This is technical implementation, not legal advice.
How is this different from another dashboard?
A dashboard is a view. This is identity and delivery: the same sale carries its source across the hop and reaches each platform once.
More like this
Hi, I’m Daniil.
I work with you from defining the problem to implementation and handover. You talk to the person who does the work. I work in English and Russian; written correspondence in Spanish with translation support.
Have a task like this?
Describe your taskThe first answer is free, within one working day. Or write directly: next@taskfordaniel.com