CustomerJourneySummary referralCode no longer consistently populating

CustomerJourneySummary referralCode no longer consistently populating

fuzzy
Shopify Partner
8 0 8

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:
1. Visit https://mystore.myshopify.com/products/product?ref=myrefcode

2. Place an order for the product I just visited using the normal Shopify checkout

3. 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.

Replies 3 (3)

Liam
Community Manager
3108 341 881

Hi Fuzzy,

 

This does sound unusual - I've reached out to our internal dev team to take a closer look into why this might be happening. 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Liam
Community Manager
3108 341 881
Hi Fuzzy,
 
Our internal team tested this and can confirm that the referral code should show up even if Shop Pay is being used. Here's the full flow we used to replicate this:
  1. Created the product link with the ref code
  2. Accessed the link in incognito mode in Chrome 
  3. Immediately clicked "Buy with Shop Pay" on the product page, rather than proceeding to a cart/checkout
  4. Paid for the order at checkout via the Shop Pay account
Then, it took about 2-3 minutes for the referral code to filter in under the firstVisit array when we queried the order. Do the visit fields ever filter in after some time on your side, or do they always stay null?
 
 

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Miguelgemss
Shopify Partner
1 0 0

Hi Liam,

 

I am experiencing the exact same issue on my side.

After purchasing using Shopify url with unique ref param and after waiting 5 min before requesting the order response, I am receiving empty values in firstVisit and lastVisit fields.

 

I can share shopify store details in order to test it properly

 

Thanks