LAUNCH$167 covers Shopify today. Buy now, get a free re-run when Klaviyo, Meta, and GA4 ship in two weeks. Price moves to $297 after. Lock in $167
DATA/GAPRUN A FREE AUDIT
FIELD NOTES·GUIDE·MAY 13, 2026

How to capture UTM parameters on every Shopify order (three options)

Open any Shopify order. Look for utm_source. It's not there. Shopify never asked the customer where they came from, never wrote it to the order, never surfaced it in any report. If you want attribution by marketing channel, you have to put it there yourself.

Three approaches, ranked by effort.

Option 1: Customer Events pixel (no theme edits)

Shopify Customer Events runs sandboxed JavaScript on every storefront page including checkout. Use it to grab utm_source, utm_medium, utm_campaign from the landing URL, write them to a first-party cookie, and attach them to the cart via the Storefront API as note_attributes.

This is the cleanest path. No theme.liquid edits. Works on Plus and non-Plus stores. Survives theme updates.

Option 2: Hidden cart input fields (light code)

Add hidden inputs to your cart form that capture utm parameters from the URL on page load. When the customer checks out, the values get submitted as cart attributes and end up in the order's note_attributes JSON.

<!-- Add to your cart form template -->
<input type="hidden" name="attributes[utm_source]" value="" data-utm-source>
<input type="hidden" name="attributes[utm_medium]" value="" data-utm-medium>
<input type="hidden" name="attributes[utm_campaign]" value="" data-utm-campaign>
<script>
  const params = new URLSearchParams(window.location.search);
  for (const key of ['utm_source', 'utm_medium', 'utm_campaign']) {
    const el = document.querySelector('[data-' + key.replace('_', '-') + ']');
    if (el && params.get(key)) el.value = params.get(key);
  }
</script>

Option 3: Server-side tools (ongoing cost)

Tools like Triple Whale, Northbeam, and Elevar capture click IDs server-side and stitch them to orders post-purchase. More accurate, more expensive ($179-$599 per month). Right for $1M+ ARR stores where every percentage point of attribution matters.

How to verify it works

Open a recent order in Shopify Admin. Scroll to Additional Details. You should see utm_source, utm_medium, utm_campaign listed there. Alternatively query the Admin API for the order's note_attributes array.

A DataGap audit pulls a sample of recent orders and reports attribution_source coverage as a percentage. If you have 30% coverage, you're misattributing 70% of orders.

RUN THE AUDIT
Want to know which of these gaps your Shopify store has right now?

DataGap connects to your Shopify store via read-only OAuth and returns a ranked list of tracking gaps in 10 minutes. $167 one-time. No subscription.

Run a free audit

Frequently asked

Will Shopify's source_name field work as a substitute?

Only partially. source_name tells you the high-level surface (web, pos, draft_order) but not the marketing channel. You still need utm_* to know whether a web order came from Meta, Google, organic, or email.

Do I need to clear the cookie after the order completes?

Optional. Most teams set a 30-day max-age on the cookie so post-purchase events also get attributed correctly.

RELATED FIELD NOTES