As per the CustomerJourneySummary GraphQL documentation, you can pass a ref query param into the shopify store URL on load, which should subsequently populate the customerJourneySummary.firstVisit.referralCode and customerJourneySummary.lastVisit.referralCode fields after a customer checks out. Our Shopify app had been successfully using this method for the past year to track referral codes in orders placed for brands we work with. I check the values using:
query Orders {
orders(query:"some query", first: 25) {
edges {
node {
createdAt
customerJourneySummary {
ready
lastVisit {
referralCode
occurredAt
}
firstVisit {
referralCode
occurredAt
}
}
tags
}
}
}
}
I recently noticed a sharp decline in the success of this field populating. Now, frequently when I pass the ref param into the page that loads the session, the referralCode no longer populates in the CustomerJourneySummary field of the Order object. I see several samples that indicate it potentially is happening when the user logs in and checks out using Shop Pay during checkout (e.g redirecting to https://shop.app/pay/transactions/new/token/... during checkout), but it does appear to be happening across normal checkout sessions as well.
I was able to reproduce this in a controlled environment with these steps:
-
Visit https://mystore.myshopify.com/products/product?ref=myrefcode
-
Place an order for the product I just visited using the normal Shopify checkout
-
Use the Admin API to check the above GraphQL query, and verify that firstVisit and lastVisit are both null (after customerJourneySummary indicates as ready).
Has anyone experienced this? Is there potentially a regression? If someone on the Shopify side can help investigate, I’m more than happy to share order GIDs from orders where I know the ref tag was set but the referralCode in customerJourneySummary did not set. We see this issue across multiple brands we work with, so I don’t believe it’s brand specific.