How to Fix Shopify UTM Tracking and Stop Losing Attribution Data

Elsid Malasi

Written by Elsid Malasi

Technical SEO expert

Fix Shopify UTM Tracking

A large share of your paid revenue is showing as Direct in GA4. No source. No medium. No campaign. You're paying for traffic you can't attribute. The problem isn't GA4. It's that UTMs break on Shopify and that Shopify doesn't write UTM data to orders by default. 

This post covers all three failure points, the naming convention that keeps GA4 channel grouping intact, and a 15-minute audit to confirm your tags are actually reaching your orders.

What a UTM Link Actually Looks Like

A UTM-tagged URL is a standard product URL with five tracking parameters appended. When someone clicks that link, GA4 reads those parameters and records the session's source.


The UTM link structure

A sample UTM link would look like this:

https://yourstore.com/products/summer-tee?utm_source=facebook&utm_medium=paid_social&utm_campaign=summer_sale_2026_q3&utm_term=mens+graphic+tees&utm_content=carousel_red_variant

The table below breaks down its components, showing the three required parameters for all UTM links and the optional ones.

Field

Example value

What it tells GA4


utm_source

facebook

Which platform sent the click

Required

utm_medium

paid_social

Which channel type

Required

utm_campaign

summer_sale_2026_q3

Which campaign

Required

utm_term

mens+graphic+tees

Which keyword (paid search) or audience (paid social)

Optional

utm_content

carousel_red_variant

Which ad variant or creative

Optional

How to Create UTM Links for Shopify

The simplest option is Google's Campaign URL Builder. Fill in the fields, copy the URL, and paste it into your ad or email.

For teams running multiple campaigns, a shared Google Sheets builder is more reliable. Dropdown columns for utm_source and utm_medium enforce the approved vocabulary and apply lowercase automatically, removing the naming drift that fragments GA4 reports.

Image taken from Klaviyo’s official documentation on UTM Links

Why UTM Data Disappears on Shopify

A customer clicks your Meta ad and lands on your store with utm_source=facebook&utm_medium=paid_social&utm_campaign=bfcm_2026

Shopify records the session. But when that customer places an order, the UTM data is not written to the order record. You can see 200 sessions from Facebook in Shopify Analytics. You cannot tell which of your 50 orders today came from those sessions.


Here we can see three categories: users who visit FB organically, those who came from Shopping Ads, and those who came from Meta Ads. 

How to report Shopify purchase and refund events in GA4

Flow diagram of Shopify Admin refund webhook to backend to data layer refund event through GTM into GA4

How refund events are tracked in GA4


GA4 records the purchase event with UTM parameters attached, but it ties the conversion to a session rather than to a Shopify order ID. So GA4 can tell you a purchase happened from a campaign. It cannot tell you which Shopify order number that was, which makes revenue reconciliation between the two platforms impossible without extra tooling or techniques.

The Three Places UTMs Break on Shopify

1. The checkout domain handoff

When a buyer clicks Checkout, the URL moves from yourstore.com/cart to a checkout subdomain. Shopify has been migrating all stores to use the shop's own domain for checkout rather than checkout.shopify.com, so for most standard stores today UTMs survive this transition.

The persistent risk is on Plus stores using a custom checkout subdomain (e.g. checkout.yourbrand.com), where the domain handoff drops the UTM query string unless GA4 cross-domain tracking covers both domains.

To fix this: GA4 > Admin > Data Streams > Web > Tagging Settings > Configure your domains.

Add both yourstore.com and checkout.yourstore.com. Without this, GA4 treats checkout as a referral visit. The symptom is your own checkout domain appearing as a top traffic source.

The various data streams on the GA4 dashboard

2. Payment gateway redirects

PayPal, Klarna, Afterpay, and some regional gateways redirect the buyer off your domain to complete payment and return them to the thank-you page. The return URL almost never carries the original UTMs. On standard Shopify checkout, session storage usually bridges this. 

On Plus stores with third-party checkout apps or extension scripts, it often fails, and the order lands attributed to Direct. Shop Pay runs within the Shopify checkout flow and is generally not the cause of this issue.

3. The thank-you page reload

Some post-purchase upsell apps trigger a page reload on the order confirmation page. That reload can reset the session and drop the UTM before Shopify writes it to the order record. If you use any app that modifies the thank-you page, test a purchase with a tagged URL and confirm the Conversion Summary in the order admin shows the correct source, medium, and campaign.

Session by a different source in the Shopify Analytics dashboard

How to Run a 15-Minute UTM Audit

  1. Build a tagged test URL: yourstore.com/products/your-product?utm_source=facebook&utm_medium=paid_social&utm_campaign=audit_test_june_2026

  2. Open an incognito window in Chrome and paste the URL.

  3. Open DevTools (F12 > Network tab). Confirm UTM parameters are visible in the first pageview request URL.

  4. Add the product to cart. Check that the UTM parameters are still present in the network requests.

  5. Click Checkout. On a Plus store with a custom checkout subdomain, this is the stage most likely to drop attribution.

  6. Complete a test purchase using a $0.01 discount code.

  7. Open the order in Shopify admin. Check the Conversion Summary box. Source, Medium, and Campaign should match exactly what you tagged.

If any field is blank or shows (direct), start with the GA4 cross-domain config. That is the most common cause.


View from the DevTools Dashboard showing the UTM link parameter

Getting UTMs Onto Your Orders (Not Just Your Sessions)

Shopify's session tracking and GA4's event-based attribution both confirm a conversion happened. Neither tells you which specific order it corresponds to without extra setup.

To connect UTMs to actual order records, you have two options.

  • Custom JavaScript via cart attributes.

A script in your theme reads UTM parameters on page load, stores them in a cookie, and writes them into cart attributes before checkout. Those attributes appear in the order in the Shopify admin. There is no app cost, but you will need a developer to implement and maintain it, especially across theme updates.

  • A purpose-built attribution app.

These tools capture UTMs via Shopify's Web Pixel API, persist them through checkout, and write structured data to order metafields: queryable, exportable, and usable in Shopify Flow automations.

Either way, the goal is to move from knowing Facebook drove 200 sessions to knowing Facebook's BFCM campaign drove 31 orders totaling $4,280. That is the number you need for actual ROAS.

The Right Naming Convention To Keep GA4 Channel Grouping Intact

GA4 uses utm_medium as the primary field to classify sessions into Default Channel Groups. If your value does not match GA4's expected vocabulary, the session lands in Unassigned, invisible in standard channel reports.

utm_medium=social looks harmless. It sends your Meta ad traffic into Organic Social in GA4, not Paid Social. 

Here is the fixed vocabulary:

Channel in GA4

utm_medium value

Paid Search

cpc

Paid Social

paid_social

Organic Social

organic_social

Email

email — use for all email campaigns, including Klaviyo flows

SMS

sms

Affiliates

affiliate

Display

display

Referral

referral

Use these exactly. The channel grouping engine is regex-based and case-sensitive. utm_source should be the platform name, lowercase: google, facebook, klaviyo, tiktok. Not abbreviations. For utm_campaign, include a year or quarter in every name. spring_sale is useless by July. spring_sale_2026_q2 is not.

If you are using Klaviyo, the app has a built-in UTM auto-tagging setting under account settings that automatically applies source, medium, and campaign to every link. If you are sending Klaviyo flows without enabling this, turn it on. It takes two minutes and removes the risk of manual errors across every email you send.

Consider what happens when four people tag the same Meta campaign differently across a quarter:

  • facebook / cpc

  • Facebook / CPC

  • fb / paid-social

  • meta / paid_social

  • Plus an untagged dark-post landing in Direct

In GA4, those become five separate source/medium pairs. One strong campaign looks like five weak ones. No attribution model fixes this retroactively. If you are running Facebook and Instagram campaigns through Shopify, consistent source and medium values are the difference between readable campaign data and noise.

Two things that also silently break UTM data:

  • Internal links with UTM parameters overwrite the original session source. UTMs are for external inbound links only.

  • Google Ads with manual UTMs. Google Ads passes click data to GA4 via the gclid parameter. Manual UTMs added on top of gclid override it and break cost-per-click attribution. Leave Google Ads destination URLs untagged.

The Governance Layer

A naming convention that lives in one person's head is not a naming convention. The minimum that that you should have in place is one shared document listing approved source and medium values, one named owner who approves additions, one URL builder that enforces lowercase, and a monthly check in GA4 > Traffic Acquisition with Session Source / Medium as a secondary dimension. 

Duplicate entries mean someone deviated. Fix it going forward.

What Shopify Reports and GA4 Will Never Agree On

Shopify uses last-click attribution. GA4 defaults to data-driven attribution, but only kicks in once you hit 400 conversions per key event; below that, it silently falls back to last-click too. 

Check Admin > Attribution Settings in GA4 to confirm which model is actually running on your property.

Use Shopify's order-level UTM data for ROAS calculations. Use GA4 for funnel analysis and channel trends.

What Changed in 2026

  • Checkout extensibility is now the only option to edit checkout.

For Plus stores, the August 2025 deadline has passed. For non-Plus stores, the cutoff is August 26, 2026. What will break after these migration deadlines is not the checkout UI, it is the analytics layer. Stores that migrated but did not rebuild their tracking pixels via Shopify's Customer Events API are currently missing purchase events. 

If you are not sure whether your Google Tag Manager setup on Shopify survived the migration, that is the first thing to check.

Shopify storefront with Tag Assistant Connected panel listing Google tags found and GTM container

Install Google Tag Assistant to check which tags are present on your site

  • GA4 added a native AI Assistant channel in May 2026.

Sessions from ChatGPT, Gemini, DeepSeek, Copilot, and Grok are now automatically classified with no configuration required. If you see Direct drop slightly after mid-May 2026 and AI Assistant appear, that is attribution improvement, not a traffic change.


Learn all you need to know about how to track AI traffic directly from your GA4 Dashboard

Start With the Audit

Run the 15-minute audit first. Find out where your UTMs are dying before changing anything else. Once the technical layer is confirmed, set the naming convention, assign an owner, and build the URL builder.

If you want a second set of eyes on your tracking setup, need help rebuilding analytics after a checkout extensibility migration, or to match your AI traffic tracking at the level of top brands. Book a free consultation with our team.

FAQs on Shopify UTM Tracking

Can I see UTM data inside Shopify admin without a third-party app?

Partially. Shopify shows UTM source, medium, and campaign on individual orders in the Conversion Summary box natively. At the campaign level, Analytics > Marketing > Sales by Marketing Campaign shows attributed revenue by campaign name, but only with last-touch attribution and no ad spend data. You cannot see which specific orders came from a campaign, and you cannot calculate ROAS without connecting order-level UTM data to revenue, which requires the extra setup described earlier in this post.

Do UTM parameters affect SEO?

No. UTM parameters have no effect on how Google ranks your pages. They are ignored for ranking purposes. One thing worth knowing: if UTM-tagged URLs get crawled and indexed, Google may treat them as duplicate content. Adding a canonical tag pointing to the clean URL on your key landing pages prevents this. Shopify does not add these automatically, so if UTM-tagged product URLs are appearing in Search Console coverage reports, that is the fix.

What happens to UTMs when someone shares a tagged link?

The UTM data travels with the link. If a customer forwards a UTM-tagged email to a friend and that friend clicks it, their session gets attributed to your email campaign. The same applies to links copied from ads and shared in messaging apps or on social media. On high-volume campaigns, this inflates email and paid social numbers slightly. It is a known limitation with no clean fix, and it is one reason UTM data should be read as directional rather than precise.

Do UTMs work with Shopify Markets?

Generally yes. Shopify's native URL redirects preserve query strings including UTM parameters, so the standard Markets locale redirect from yourstore.com to yourstore.com/en-gb should pass UTMs through correctly. The risk is with third-party redirect apps or custom Liquid-based redirects in the theme, which may strip query strings depending on how they are configured. Run the 15-minute audit described earlier using a market-specific URL to confirm before launching a campaign targeting a specific market.

When do I need more than three UTM parameters?

The three required fields cover most campaigns:

  • utm_source — the platform (Facebook, Google, Klaviyo)
  • utm_medium — the channel type (cpc, paid_social, email)
  • utm_campaign — the campaign name (bfcm_2026_q4)

Add utm_content when running multiple creatives or CTA variants in the same campaign, and you need to know which one converted.

Add utm_term when running paid search, and you want keyword-level conversion data in GA4.

If you are not A/B testing creatives or optimizing at the keyword level, skip both. They add maintenance overhead without a meaningful reporting benefit.

Elsid Malasi

Technical SEO expert

Elsid is a digital marketing specialist with 6+ years of experience in PPC, Meta Ads, TikTok Ads, and a major focus on SEO, including on-page, off-page, and technical optimization. Proficient in managing WordPress, Magento, Shopify, Prestashop and other CMS, he blends technical expertise with data-driven strategies. Fluent in Italian and English, he excels at creating clear, precise reports that help clients make informed decisions.