The Complete Guide to UTM Tracking for Shopify Stores
If you’re spending money on ads, sending emails, or working with influencers, you need to know which efforts are actually driving sales. UTM parameters are the foundation of that visibility — and yet most Shopify merchants either skip them entirely or use them inconsistently.
This guide walks you through everything you need to know about UTM tracking for Shopify: how to structure your parameters, set them up across every major channel, and actually connect that data to orders in your store.
What Are UTM Parameters?
UTM (Urchin Tracking Module) parameters are tags you append to the end of a URL. When someone clicks a link with UTM parameters and lands on your store, analytics tools — including Google Analytics, Shopify’s own reports, and third-party attribution apps — can read those tags and tell you where that visitor came from.
A typical UTM-tagged URL looks like this:
https://yourstore.com/products/summer-tee?utm_source=facebook&utm_medium=paid_social&utm_campaign=summer_sale_2026&utm_content=carousel_ad_v2
There are five standard UTM parameters:
| Parameter | Purpose | Example |
|---|---|---|
utm_source | The platform or referrer | facebook, google, klaviyo |
utm_medium | The marketing medium | paid_social, cpc, email |
utm_campaign | The specific campaign | summer_sale_2026 |
utm_content | Differentiates ad variations | carousel_v2, hero_image |
utm_term | Keyword targeting (mostly for search) | running+shoes |
The first three — source, medium, and campaign — are considered essential. Content and term are optional but valuable when you need to compare ad creatives or keyword performance.
Why UTM Tracking Matters for Shopify Merchants
Shopify’s built-in analytics give you a high-level view of where sessions come from, but that data has significant gaps:
- No ad-level granularity. Shopify can tell you traffic came from Facebook, but not which campaign, ad set, or creative drove it.
- Session-based, not order-based. You see session sources, but connecting a specific order to a specific ad requires additional tracking.
- Cross-device gaps. A customer who clicks an ad on mobile but purchases on desktop may appear as direct traffic.
UTM parameters fill these gaps by giving you a consistent, platform-agnostic way to label every inbound link. When combined with an attribution tool that captures UTMs at the order level, you get a clear picture of marketing ROI.
Establishing a UTM Naming Convention
Before you tag a single URL, establish a naming convention and document it. Inconsistency is the number one reason UTM data becomes useless.
Rules for Your Convention
Use lowercase only. UTM parameters are case-sensitive. Facebook, facebook, and FACEBOOK will appear as three separate sources in your reports. Always use lowercase.
Use underscores instead of spaces. Spaces get encoded as %20 in URLs and create messy data. Use underscores (summer_sale) or hyphens (summer-sale) — pick one and stick with it.
Be specific but not verbose. Your campaign names should be descriptive enough to identify without opening a spreadsheet, but short enough to be readable.
Include dates or identifiers in campaigns. spring_sale is ambiguous across years. spring_sale_2026_q2 is not.
Recommended Naming Structure
Here is a naming structure that works well for most Shopify stores:
| Parameter | Format | Examples |
|---|---|---|
utm_source | Platform name, lowercase | meta, google, klaviyo, tiktok |
utm_medium | Channel type | paid_social, cpc, email, influencer, organic_social |
utm_campaign | {goal}_{descriptor}_{date} | retarget_atc_apr2026, launch_summer_collection |
utm_content | Ad or content identifier | video_30s_v2, email_hero_cta |
utm_term | Keyword or audience | brand_exact, lookalike_1pct |
Document this convention in a shared spreadsheet or wiki that everyone on your team can reference.
Setting Up UTMs by Channel
Meta Ads (Facebook & Instagram)
Meta Ads Manager supports dynamic UTM parameters that auto-populate based on your campaign structure. This is the recommended approach because it eliminates manual errors.
At the ad level in Ads Manager, scroll to the Tracking section and set your URL parameters:
utm_source=meta&utm_medium=paid_social&utm_campaign={{campaign.name}}&utm_content={{ad.name}}&utm_term={{adset.name}}
The double-brace syntax ({{campaign.name}}) pulls the actual name from your campaign, ad set, or ad. This means your UTM values will always match what you see in Ads Manager.
Important: Set this at the account level using Meta’s URL parameter template so it applies to all new campaigns automatically.
Google Ads
Google Ads has auto-tagging via gclid, which works well with Google Analytics but does not populate UTM fields in Shopify or third-party tools. For complete tracking, add manual UTM parameters alongside auto-tagging.
In your Google Ads campaign settings, use the Tracking template or Final URL suffix:
utm_source=google&utm_medium=cpc&utm_campaign={campaignname}&utm_content={creative}&utm_term={keyword}
Google Ads supports its own set of dynamic parameters (curly braces, not double curly braces). Common ones include {campaignname}, {adgroupname}, {creative}, and {keyword}.
Email Marketing (Klaviyo, Mailchimp, Omnisend)
For email campaigns, tag every link in your emails. Most email platforms let you set default UTM parameters at the campaign level.
Klaviyo example:
utm_source=klaviyo&utm_medium=email&utm_campaign=weekly_newsletter_apr18&utm_content=hero_cta
Klaviyo can also auto-append UTMs if you configure it in your account settings. Enable this to avoid tagging every individual link.
Key tip: Tag your automated flows too — welcome series, abandoned cart, post-purchase. These often drive significant revenue and are frequently left untagged.
Influencer and Affiliate Links
For influencers or affiliates, create unique UTM-tagged links for each partner:
utm_source=instagram&utm_medium=influencer&utm_campaign=spring_collab_2026&utm_content=jessica_smith
Using the influencer’s name or handle in utm_content lets you attribute sales to specific partners. You can generate these links in a spreadsheet or use a UTM builder tool.
Tools like Detectly include a built-in UTM builder that lets you generate tagged links using your store’s naming convention, saving time and reducing errors when creating links for multiple partners or campaigns.
Organic Social Media
Tag the links in your social media bios and posts:
utm_source=instagram&utm_medium=organic_social&utm_campaign=bio_link
utm_source=tiktok&utm_medium=organic_social&utm_campaign=linkinbio
This distinguishes organic social traffic from paid social, which is critical for understanding what you’re getting for free versus what you’re paying for.
SMS Campaigns
utm_source=postscript&utm_medium=sms&utm_campaign=flash_sale_apr2026
SMS links are often shortened, which can strip UTM parameters. Use your SMS platform’s built-in UTM support rather than manually appending parameters to shortened URLs.
Tracking UTMs Through to Shopify Orders
Here is the critical gap most merchants miss: capturing UTM parameters is only useful if you can connect them to actual orders, not just sessions.
By default, Shopify does not store UTM data on orders. When a customer clicks your UTM-tagged link, those parameters exist in the browser URL, but they are lost by the time the customer reaches checkout and places an order.
To bridge this gap, you need a mechanism that:
- Captures UTMs on landing. When a visitor arrives with UTM parameters, store those values (typically in a browser cookie or localStorage).
- Persists across the session. The visitor may browse multiple pages before purchasing. The UTM data needs to survive navigation.
- Attaches UTMs to the order. When the customer completes checkout, the stored UTM data needs to be written to the order record.
Manual Approaches
You can build this yourself using Shopify’s cart attributes or order note attributes. The general approach is:
- Add JavaScript to your theme that reads UTM parameters from the URL on page load.
- Store them in a cookie with a reasonable expiration (7-30 days).
- Before checkout, write the cookie values into cart attributes.
- Those attributes then appear on the order in Shopify admin.
This works but requires ongoing maintenance, and cart attributes are not the same as structured metafields — they are harder to query and export.
Using an Attribution App
Attribution apps like Detectly handle this automatically. Detectly captures UTM parameters via a lightweight script, persists them through the customer’s session, and writes structured attribution data directly to order metafields and customer tags. This means every order in Shopify shows exactly which campaign, source, and medium drove it — queryable, exportable, and visible right in the order details.
Common UTM Tracking Mistakes
Inconsistent Naming
The most damaging mistake. If one team member uses Facebook and another uses facebook and a third uses fb, your reports fragment into three separate sources that all mean the same thing.
Fix: Document your convention, share it with your team, and use templates or a UTM builder to enforce consistency.
Tagging Internal Links
Never use UTM parameters on links within your own site (e.g., navigation links, banner links). UTMs are for external inbound traffic only. Internal UTMs overwrite the original source data, making it look like your own site is a traffic source.
Forgetting to Tag Automated Flows
Your welcome series, abandoned cart emails, and post-purchase flows may drive 30-50% of your email revenue. If those links are not tagged with UTMs, that revenue appears as “direct” traffic.
Using UTMs on Organic Search
Do not try to add UTM parameters to your organic Google search results — you cannot control those URLs. Organic search tracking is handled by analytics tools reading the referrer header. UTMs are only for links you control.
Not Accounting for Redirects
If you use a URL shortener or redirect service, make sure it preserves UTM parameters. Some shorteners strip query parameters, which means your UTMs disappear before the customer reaches your site.
Ignoring Mobile App Traffic
Links opened inside social media apps (Instagram’s in-app browser, TikTok, etc.) can sometimes behave differently than standard mobile browsers. Test your UTM-tagged links in the actual apps your customers use, not just in a desktop browser.
Measuring UTM Performance in Shopify
Once your UTMs are being captured and attached to orders, you can analyze performance at the level that matters — revenue, not just clicks.
Key reports to build:
- Revenue by source/medium. Which channels drive the most revenue? Compare
meta / paid_socialagainstgoogle / cpcagainstklaviyo / email. - Revenue by campaign. Which specific campaigns are profitable? Compare campaign-level revenue against ad spend to calculate true ROAS.
- Revenue by content. Which ad creatives or email variations perform best? Use
utm_contentto compare. - Customer acquisition cost by channel. Divide channel spend by the number of new customers attributed to that channel.
You can build these reports manually by exporting orders with UTM metafields, or use a tool like Detectly’s analytics dashboard, which aggregates this data automatically and presents channel-level and campaign-level breakdowns.
Quick-Start Checklist
Use this checklist to get UTM tracking set up for your Shopify store:
- Document your UTM naming convention (lowercase, underscores, date format)
- Set up dynamic UTM templates in Meta Ads Manager
- Add UTM tracking templates to Google Ads campaigns
- Configure default UTMs in your email platform (Klaviyo, Mailchimp, etc.)
- Tag links in automated email and SMS flows
- Create UTM-tagged links for influencer and affiliate partners
- Tag organic social bio links
- Implement UTM capture on your storefront (script or app)
- Verify UTM data is appearing on test orders
- Build your first revenue-by-channel report
Wrapping Up
UTM tracking is not glamorous, but it is the single most impactful thing you can do to understand your marketing performance. Without it, you are making budget decisions based on incomplete data.
The key is consistency: establish a convention, enforce it across every channel, and make sure UTM data flows all the way through to your Shopify orders. Whether you build a custom solution or use a tool like Detectly, the goal is the same — every order should tell you exactly where that customer came from and what convinced them to buy.
Ready to see your true ROAS?
Detectly tracks every UTM, attributes every Shopify order, and shows you which channels actually drive revenue.