How to get attribution data for orders - how can I identify the source of an order - like session utms, gclid, fbclid etc? Can I get these information through the api? Where should I get started?
I’m trying to automate some of the tasks i do pulling out order exports and conversion session information manually. i’m looking to specifics as to gclid / fbclid associated with the order or the data that shopify uses to identify orders and send CAPI events to meta
Hi @RV_Prakash
Does the resourceName meet your requirements
order - resourceName - GraphQL Admin
Nope. the source name doesnt help,i’m looking to specifics as to gclid / fbclid associated with the order or the data that shopify uses to identify orders and send CAPI events to meta
Hi @RV_Prakash! Sounds like the customerJourneySummary on the Order object is the closest to what you described - it tracks the customer’s path to purchase including UTMs and referral info.
For example:
{
orders(first: 10) {
edges {
node {
id
name
customerJourneySummary {
ready
firstVisit {
source
landingPage
referrerUrl
utmParameters {
campaign
source
medium
content
term
}
}
lastVisit {
source
landingPage
utmParameters {
campaign
source
medium
}
}
}
}
}
}
}
The utmParameters object gives you the standard UTM params (campaign, source, medium, content, term). You also get source (platform like Facebook/Google), landingPage (first URL they hit), and referrerUrl (where they came from).
For gclid/fbclid specifically - those aren’t exposed as dedicated fields. They’re platform-specific click identifiers, not standard UTM params. Your best bet is to parse them from the landingPage URL if they’re present in the query string when the customer landed. Not ideal, but Shopify doesn’t break those out separately in the API.
The CustomerVisit object also has referralCode which captures ref/source/r URL parameters if you’re using those for tracking.