MerchantFlowMerchantFlow Docs
Integrations

UTM Tracking for Revenue Attribution

Set up UTM parameters to attribute e-commerce revenue to specific marketing channels and campaigns in MerchantFlow. Includes recommended UTM structures.

UTM Tracking for Revenue Attribution

UTM tracking in MerchantFlow uses UTM parameters from your order URLs to attribute revenue to specific marketing channels, campaigns, and traffic sources. By adding UTM tags to your marketing links, you can see exactly which campaigns drive sales and calculate true channel-level return on ad spend.

How UTM Attribution Works

When a customer clicks a link with UTM parameters and makes a purchase, MerchantFlow captures those parameters from the order data and uses them for revenue attribution.

UTM parameters tracked:

  • utm_source -- the traffic source (e.g., google, facebook, newsletter)
  • utm_medium -- the marketing medium (e.g., cpc, social, email)
  • utm_campaign -- the specific campaign name (e.g., spring_sale, holiday2025)
  • utm_term -- the keyword or search term
  • utm_content -- the creative or link variant

All five are stored on the order. utm_source and utm_medium drive channel grouping; utm_campaign, utm_term, and utm_content are kept for campaign-level breakdowns.

Attribution Precedence and Confidence

MerchantFlow resolves each order against four rules in order and stamps a confidence level on the result:

RuleSourceConfidence
1Stored multi-touch attribution record on the orderHigh
2UTM parameters on the orderMedium
3The platform's own primary-source fieldMedium
4Nothing usable -- reported as UnattributedLow

The first rule that matches wins. When an order carries both UTM parameters and a platform source field, UTM parameters take priority.

Referrer data is not a separate rule at this stage. It is resolved earlier, during the Shopify order sync: when an order has no utm_source, MerchantFlow maps the visit's referrer domain onto a source and medium and writes those into the order's UTM fields. Referrer-derived attribution therefore lands as Medium confidence, indistinguishable from an explicitly tagged link.

Attribution Is Gated Per Workspace

Per-channel attribution is controlled by the attribution_enabled feature flag and is off unless MerchantFlow enables it for your workspace. It resolves to off when the flag row is missing, when it is disabled, when your workspace is not on its allowlist, and whenever the lookup fails. No plan tier unlocks it.

While it is off, MerchantFlow treats the stored primarySource and UTM fields as unreliable and withholds them from the attribution surfaces, from AI context, and from Flow and MCP output rather than showing numbers it does not trust. The MCP tool run_sales_by_channel_report refuses outright, and blended cost mode is forced on so ad spend is spread across every order.

Capture is not gated. UTM parameters, the referrer fallback, primarySource, and all five attribution models are still written to every order on every sync while the flag is off. Turning the flag on surfaces data that is already there; it does not start collection from that day. Contact MerchantFlow support if you expect attribution surfaces and do not see them.

Referrer Fallback

When UTM parameters are not present, MerchantFlow falls back to the order's referrer URL to determine the traffic source. The referrer domain is matched against a fixed map:

  • Search engines -- google.com (and country domains), bing.com, yahoo.com, duckduckgo.com, baidu.com, yandex.com, yandex.ru, ecosia.org, mapped to an organic medium
  • Social platforms -- facebook.com, instagram.com, tiktok.com, pinterest.com, twitter.com, x.com, t.co, reddit.com, linkedin.com, youtube.com, mapped to a social medium
  • AI referrals -- chatgpt.com and chat.openai.com, mapped to a referral medium
  • Any other referrer domain -- kept as the source with a referral medium
  • No referrer at all -- MerchantFlow falls back to Shopify's own order source identifier: a POS sale becomes pos / in-store, a draft order becomes manual / draft-order, and an order placed in the Shopify mobile app becomes shopify-mobile / app. Anything else stays Direct or Unattributed

Referrer mapping runs during the Shopify order sync, using the visit recorded in Shopify's customer journey summary -- the last visit where one exists, otherwise the first. Subdomains resolve to their parent, so www.google.com and l.facebook.com map the same way as the bare domains.

WooCommerce stores pass UTM and referrer values through their own _wc_order_attribution_* order meta. The referrer domain map above is part of the Shopify sync specifically, so a WooCommerce referrer is kept verbatim as the source with a referral medium.

How to Set Up UTM Tracking

URL Format

Add UTM parameters to your marketing links:

https://yourstore.com/product?utm_source=facebook&utm_medium=paid_social
Channelutm_sourceutm_mediumChannel group
Google ShoppinggoogleshoppingShopping
Google Search AdsgooglecpcPaid Search
Facebook Adsfacebookpaid_socialSocial
Instagram Adsinstagrampaid_socialSocial
TikTok Adstiktokpaid_socialSocial
Snapchat Adssnapchatpaid_socialSocial
Pinterest Adspinterestpaid_socialSocial
Email MarketingnewsletteremailEmail
SMS CampaignssmsemailEmail

Two details matter here. Use utm_medium=shopping (or product_listing) for Google Shopping -- cpc puts that spend in Paid Search instead. And an sms medium has no rule of its own, so SMS lands in Other; tag SMS with utm_medium=email if you want it grouped with your other owned-audience sends.

Platform-Specific Setup

Google Ads -- Add explicit UTM parameters. Google Ads auto-tagging alone is not enough: MerchantFlow's order attribution reads UTM fields and the referrer, and does not read Google's gclid from your orders. Set utm_source=google and utm_medium=cpc (or shopping for Shopping campaigns) in the tracking template or final URL suffix.

Meta Ads -- Use URL parameters in your ad creative. Set utm_source=facebook and utm_medium=paid_social in the URL parameters field.

Email/SMS -- Add UTM parameters to all links in your campaigns. Most email platforms (Klaviyo, Mailchimp) support automatic UTM tagging.

Where to View Attribution Data

Attribution data is available in several places:

  • Revenue Attribution card on the dashboard, and its Detailed Analytics modal -- revenue breakdown by traffic source. See Traffic Sources
  • Products → any product -- an Attribution Breakdown card showing revenue sources for that SKU, using the raw source strings from its orders
  • Orders -- a Traffic Source filter and a per-order source value. Both are hidden while blended cost mode is on, which includes every workspace without the attribution_enabled flag
  • Marketing → Attribution -- projects, channels, and rules. This page lists configuration, not revenue

Traffic Source Categories

These are the groups MerchantFlow derives at read time from the order's source and medium pair, for orders resolved by rules 2 and 3 above. Orders resolved by rule 1 -- those with a stored multi-touch record -- carry a finer set of groups that splits paid from organic; see Attribution System.

  • Organic -- google with an organic medium
  • Shopping -- google with a shopping or product_listing medium
  • Paid Search -- google with a cpc or ppc medium
  • Social -- facebook, instagram, meta, twitter, linkedin, tiktok, snapchat, or pinterest as the source
  • Email -- email as the source, or any medium of email
  • Referral -- any medium of referral
  • ChatGPT -- chatgpt, openai, claude, bard, or gemini as the source, when the medium is not already referral
  • Direct -- an explicit direct or (direct) source
  • Other -- a source that matches none of the above. MerchantFlow deliberately does not guess Organic here
  • Unattributed -- no usable source at all

How to Troubleshoot UTM Attribution Issues

Orders showing "Direct" when they should not

  1. Check UTM parameters -- verify your marketing links include UTM parameters
  2. Check referrer data -- some browsers and privacy tools strip referrer information
  3. Cross-domain tracking -- ensure UTM parameters persist across redirects
  4. Platform setup -- verify your e-commerce platform passes UTM data to the order

Attribution differs from ad platform reports

  • Attribution windows -- ad platforms use their own attribution windows; MerchantFlow uses last-touch by default
  • Cross-device -- ad platforms may track cross-device conversions that UTM tracking cannot
  • Click vs. view -- UTM only tracks click-through conversions, not view-through

Frequently Asked Questions

Do I need UTM parameters if I already have Google Ads auto-tagging?

Yes. MerchantFlow's order attribution does not read gclid -- it reads the UTM fields and the referrer stored on the order. Auto-tagging on its own leaves those orders to fall back to the referrer or to Unattributed, so add explicit UTM parameters to your Google Ads URLs.

(MerchantFlow does record gclid in one unrelated place: its own paid-landing-page tracking for MerchantFlow signups. That has nothing to do with your store's order attribution.)

How do I reduce the amount of "Direct" traffic in my attribution?

Add UTM parameters to every marketing link you control: paid ads, email campaigns, SMS messages, social media posts, and influencer links. The most common cause of excessive Direct attribution is missing UTM tags.

Does MerchantFlow support multi-touch attribution?

The fallback path described on this page is last-touch, based on the UTM parameters or referrer data present at the time of purchase. Where a stored attribution record exists on an order, MerchantFlow reads it under the selected attribution model and can split one order's revenue across several sources -- that is the High-confidence rule above. Most orders resolve through the last-touch fallback. See the Attribution FAQ for more details.

What happens if UTM parameters are partially present?

utm_source is the field that decides. If utm_source is present, MerchantFlow attributes the order at Medium confidence and records utm_medium as (none) when it is missing -- which usually lands the order in the Other channel group rather than the one you intended. If utm_source is missing, the UTM rule does not apply at all and the order falls through to the platform's primary-source field, then to Unattributed.

How do I set up UTM tracking for Shopify stores?

Shopify automatically captures UTM parameters from the landing page URL and associates them with the order. Ensure your marketing links include UTM parameters and that your Shopify theme does not strip URL parameters during navigation.


Last updated: August 29, 2026

Last updated on

On this page