Subject: Accessing UTM Parameters on Thank You and Order Status Pages for Targeting

Issue:
We need to access UTM parameters (source, medium, campaign, etc.) on Shopify’s checkout thank you
page and order status page for customer targeting, but struggling to retrieve this data
consistently.

Current Approach:
Using customerJourney and customerJourneySummary fields in GraphQL queries to get UTM data:

customerJourney {
moments {
… on CustomerVisit {
utmParameters {
source
medium
campaign
term
content
}
}
}
}

Problems:

  1. UTM data not always populated in customer journey
  2. Inconsistent availability between thank you vs order status pages
  3. Missing UTM context for guest checkouts
  4. Timing issues - UTM data appears delayed or incomplete

Questions:

  1. Is there a more reliable method to capture UTM parameters during checkout?
  2. Should we use checkout extensions to capture this data earlier in the flow?
  3. Are there specific Shopify APIs designed for UTM parameter tracking?
  4. What’s the recommended approach for UTM-based post-purchase targeting?

Environment:

  • Shopify Admin API 2024-10
  • Post-purchase and order status page integrations
  • Need UTM data for immediate targeting decisions

Any guidance on reliably accessing UTM parameters for targeting would be greatly appreciated.

1 Like

Hey @sameergshah, the inconsistent UTM data you’re experiencing with customerJourney is expected behavior. The customerJourney and customerJourneySummary fields rely on customer tracking consent and cookies, which means UTM data won’t populate when customers haven’t consented to tracking, are using private browsing/ad blockers, or are going through guest checkout without cookie consent. Additionally, customer journey attribution can take up to 48 hours to process after order creation.

Have you considered using the Web Pixels API instead for more customizable tracking?
Check out the Web Pixels API documentation and the build web pixels tutorial to see if it would work.