What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Order CustomerJourney data is always null

Solved

Order CustomerJourney data is always null

ds_redbrain
Shopify Partner
6 1 2

We have an app installed on +1000 Shopify stores and is used by Merchants to set-up/run Google Shopping Ads campaigns.

 

We have the create_orders webhook enabled for these stores and use the Customer Journey data (https://shopify.dev/docs/api/admin-graphql/2023-04/objects/customerjourney) to track performance of the campaigns and the orders they generate.


Since the beginning of November 2023, we have noticed a number of stores now return "null" for the CustomerJourney data related to their orders.

The Shopify API continues to return correct CustomerJourney data for some stores, however many stopped from 1st November. We have tested across a number of stores placing real orders with utm_ tracking querystrings added (example: ?utm_campaign=orderlegend&utm_source=testUTMTracking).

All tests were down in clean browsers (no existing Shopify cookies), in a standard setup of our UAT environment that we know previously successfully tracks utm data. In this environment, some stores consistently function as expected (tracking the utm data correctly in the order CustomerJourney), however others consistently return "null".


We are aware the CustomerJourney is not populated real-time when the order is placed. Delayed API calls to request CustomerJourney data always return "null" for orders we know had utm_ tracking. We tested both direct API calls and request bulk job data and both have the same result.

 

Is there any configuration, or reason why this data would not be returned for some stores?


Example GQL order query to return Customer Journey data, using API version 2023-04:

 

 

 

query {
    orders(first: 1 query: "id:5410000000000") {
      edges {
        node {
          customerJourney {
            daysToConversion
            customerOrderIndex
            moments {
              occurredAt
              ... on CustomerVisit {
                id
                landingPage
                landingPageHtml
                occurredAt
                referralCode
                referralInfoHtml
                referrerUrl
                source
                sourceDescription
                sourceType
                utmParameters {
                  campaign
                  content
                  medium
                  source
                  term
                }
              }
            }
          }
        }
      }
    }
  }

 

 





Accepted Solution (1)

ds_redbrain
Shopify Partner
6 1 2

This is an accepted solution.

Posting this for anyone who has the same issue. The reason for this was related to a GDPR update released by Shopify in November which changed the data which is available.

 

Unless the store has the correct GDPR plugin/cookie-acceptance set up, and the customer has agreed to this, the CustomerJourney defaults to "null". There is currently no way to determine if an order has no utm tracking, or there was utm data but the customer did not click the cookie consent before placing the order. In both these scenarios the API only returns "null" and Shopify Support has confirmed there is no other option available in the API to check if the customer agreed/disagreed to tracking consent.

 

There is an option for the Merchant to disable this behaviour by the Merchant by setting the Customer privacy option to "Collect before consent" in: https://admin.shopify.com/store/<shopify_store>/online_store/preferences

 

However I believe this option is defaulted to "Collect after consent" since the update (and on new stores), and I understand from Shopify Support the ability  to disable this functionality is going to be removed entirely in the near future so that "Collect after consent" will always be enabled.

In Summary, the CustomerJourney data returned by the API cannot be relied on to be accurate from this time onwards. It will only be populated under the following scenario:

 

1. The store has an up-to-date Shopify theme that integrates with the GDPR consent option provided by Shopify (many of the stores with our app installed have themes 2-3 years old).

2. The customer clicks/agrees to tracking:

    a) when there is utm data in the URL and

    b) before placing an order/putting items in the cart.

 

View solution in original post

Replies 5 (5)

Liam
Community Manager
3108 344 895

Hi Ds_redbrain,

 

How long is the interval between the order being completed and when you are querying for CustomerJourney? When some stores are returning null, is it for all orders on that store or only some orders?

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

ds_redbrain
Shopify Partner
6 1 2

Hi Liam, 

> How long is the interval between the order being completed and when you are querying for CustomerJourney?

We have tested from 5 mins after the order is placed, and retried again at various times for the next +48 hours. From previous documentation I understood the CustomerJourney data can take up to 48 hours to populate.

When some stores are returning null, is it for all orders on that store or only some orders?
From our testing, after 1 November some stores return "null" for all orders.

Let me know if I can provide you with any further data.



Liam
Community Manager
3108 344 895

Hi again Ds_redbrain,

 

I'm not seeing other reports of the same issue on other stores - you may need to contact support directly with examples of stores where this is happening so that our API support team can dig into the actual API calls and headers to see what might be happening here.  

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

ds_redbrain
Shopify Partner
6 1 2

Thanks, I already have a Support Ticket open: Ticket number 43440934

 

I am updating this now with further information and the list of around x25 stores which we see this happening on.

ds_redbrain
Shopify Partner
6 1 2

This is an accepted solution.

Posting this for anyone who has the same issue. The reason for this was related to a GDPR update released by Shopify in November which changed the data which is available.

 

Unless the store has the correct GDPR plugin/cookie-acceptance set up, and the customer has agreed to this, the CustomerJourney defaults to "null". There is currently no way to determine if an order has no utm tracking, or there was utm data but the customer did not click the cookie consent before placing the order. In both these scenarios the API only returns "null" and Shopify Support has confirmed there is no other option available in the API to check if the customer agreed/disagreed to tracking consent.

 

There is an option for the Merchant to disable this behaviour by the Merchant by setting the Customer privacy option to "Collect before consent" in: https://admin.shopify.com/store/<shopify_store>/online_store/preferences

 

However I believe this option is defaulted to "Collect after consent" since the update (and on new stores), and I understand from Shopify Support the ability  to disable this functionality is going to be removed entirely in the near future so that "Collect after consent" will always be enabled.

In Summary, the CustomerJourney data returned by the API cannot be relied on to be accurate from this time onwards. It will only be populated under the following scenario:

 

1. The store has an up-to-date Shopify theme that integrates with the GDPR consent option provided by Shopify (many of the stores with our app installed have themes 2-3 years old).

2. The customer clicks/agrees to tracking:

    a) when there is utm data in the URL and

    b) before placing an order/putting items in the cart.