← All resources Product

Server-side tracking for Shopify with the Measurebase app

Shopify is where normal tagging setups quietly fall apart. The checkout is a locked environment where you can't place your own scripts, pixels run inside a sandbox that reports the wrong page URL, and by the time a payment provider has bounced the shopper around, the session and its attribution are often gone. The Measurebase Shopify app exists to close exactly those gaps: it connects your store to your own Measurebase tagging host and tracks the whole funnel server-side · storefront, checkout and the order itself.

Three surfaces, one stream

The app tracks your store from three places at once, and every one of them reports to the same tagging host with the same identifiers:

Every event the app sends

All events use GA4's standard names and shapes, so they work with your existing tags, audiences and reports without translation. Storefront events, from the theme embed:

EventFires when
view_itemA product page is viewed · with the selected variant's price
view_item_listA collection or search results page is viewed · items with list name and position
select_itemA product is clicked in a collection or search list · works across theme card layouts, including themes that don't wrap the card in a link
add_to_cartAny add to cart · quantity is the amount just added, never the running cart total
remove_from_cartAny cart removal or quantity decrease · computed by diffing the cart
view_cartThe cart page is viewed, with the full cart contents
searchA search results page is viewed · with search_term and search_results
Your custom eventsAnything published on Shopify's analytics bus · a quiz, a wishlist, an app's event · mirrored into the dataLayer under a name you choose

Checkout events, from the app pixel:

EventFires when
begin_checkoutThe checkout is opened
add_shipping_infoThe shipping step is completed
add_payment_infoThe payment step is completed
apply_discount_codeA discount code is applied · with the code and the discount amount
purchaseThe order is placed · event ID is the order ID, replays of the thank-you page are suppressed
nc_purchase / rc_purchaseOptional companions to the purchase for new and returning customers · never counted as a second conversion, only emitted when Shopify actually knows the segment

Server events, from order webhooks:

EventFires when
purchaseThe order is created · as the owning event or as a deduplicated copy, depending on the purchase mode you choose below
refundA refund is issued · classified full or partial by comparing the refunded amount against the order total, so a shipping-only refund never reverses the whole order
subscription_startedA subscription's first order is placed (opt-in)
subscription_renewedA recurring subscription order is billed (opt-in) · as an annotation event, or as a countable purchase if you want renewals in revenue

Every parameter, and why it's there

The e-commerce object

Every commerce event carries the full GA4 e-commerce object: currency, value, transaction_id, tax, shipping, coupon and order-level discount, plus an items array with item_id, item_name, item_brand, item_category, item_variant, price, quantity and per-item discount. The item ID source is configurable · product ID, variant ID, SKU or barcode · and the same choice applies on every surface, so your product feed matches from the first view_item to the server-side purchase. Money is always a clean number, never a formatted string and never floating-point noise.

Identity and matching

Events carry customer identifiers in Google's user-provided data schema, and only ever as SHA-256 hashes · plain email, phone or address never enter the dataLayer and never leave the store:

Identity is seeded into the dataLayer before GTM loads, on the storefront and in checkout alike · so the Google tag's very first hit already carries the user ID and the match keys, instead of only the events that happen to fire after everything has settled. In checkout, hashes refresh on every step as the shopper fills in more fields, so advanced matching doesn't wait for the purchase.

Click IDs that reach the conversion

Google, Microsoft, Meta and TikTok click identifiers · gclid, gbraid, wbraid, msclkid, ttclid, plus the _fbp/_fbc cookies · are captured on the landing page, stamped onto the cart, and forwarded with checkout and server events. The iOS variants gbraid and wbraid matter most: they exist precisely for the visits where every other identifier has already been stripped, and most setups drop them entirely.

Context on every event

Bookkeeping that keeps the counts honest

One purchase, never two

With three surfaces able to see the same order, the thing that matters most is that your reports only ever count it once. The app gives every purchase one event ID · the order ID itself · across all three surfaces, and lets you choose who owns the purchase:

Reloaded thank-you pages, double-pasted pixels and replayed webhooks are all suppressed · defence in depth on every surface, not an assumption that nothing ever goes wrong.

Why this is such a strong setup

Each piece above is useful on its own; the strength is what they add up to. A few claims most Shopify tracking can't make, and why this setup can:

Built for your GTM setup, not around it

You keep your own web and server containers. The dashboard generates a ready-to-import GTM template in Shopify mode: every e-commerce field mapped explicitly (the checkout sandbox ignores the usual "read from dataLayer" shortcut), a user-provided-data variable wired to the hashed fields, and the real page URL mapped in so checkout events report the checkout page rather than Shopify's internal sandbox address.

Shopify Markets is handled per storefront: a shop with multiple domains tags each one through its own host, resolved automatically · one app, one pixel, every market first-party.

Anything your store publishes through Shopify's own analytics events · a quiz completing, a wishlist add, an app's custom event · can be mirrored into the dataLayer under a name you choose, from the app's Events tab. And Enhanced Ad Blocker Protection extends into the checkout: container traffic leaves masked there too.

Seeing what's happening

The app's Test tab shows every event that reached your tagging host in the last 30 minutes · which surface sent it, its value, its products item by item, and every parameter it carried, including traffic that left through the ad-blocker mask. A console debug mode and a server-preview header are one toggle away, and both switch themselves off automatically after 24 hours, so a debugging session can't silently degrade your production data. The Setup page continuously checks each piece · embed, pixel, webhooks · and tells you when something needs attention.

Getting started

  1. Install the Measurebase app on your store and connect it to your Measurebase domain.
  2. Turn on the theme embed in your theme editor for storefront events.
  3. Import the generated GTM template from your dashboard, or map the events into your existing containers.

The checkout pixel installs itself with the app, and order webhooks are registered automatically. From the first page view to the purchase and its refund, everything flows through your own domain · first-party, deduplicated and EU-hosted like everything else on Measurebase.

Continue reading

Ready to move your tagging to Europe?

Start free, no credit card required. Live in about 15 minutes.

Start free