Re: How to receive a Webhook when CustomerJourneySummary is Populated

How to receive a Webhook when CustomerJourneySummary is Populated

affelios
Shopify Partner
1 0 3

A question for the Shopify API developers and/or anyone in the know...

Per the Shopify Documentation regarding UTM Parameters these can be obtained by making the following GraphQL request: 

 

{
  order(id: "gid://shopify/Order/4322607857715") {
    ...on Order {
      customerJourneySummary {
        firstVisit {
          utmParameters {
            campaign
            content
            medium
            source
            term
          }
        }
        lastVisit {
          utmParameters {
            campaign
            content
            medium
            source
            term
          }
        }
      }    
    }
  }
}

 

However, these are not guaranteed to be present at the time when an order is placed and may take up to 48 Hours to become available according to this: https://help.shopify.com/en/manual/orders/conversion-summary#no-conversion-summary-available 

 

As a result, when receiving an "ORDERS_PAID" webhook notification, we are unable to determine if the order has a referral using the above query.

 

Question: 

 

Our app implementation relies on knowing if there is a CustomerJourneySummary available for an order. Is there a webhook that will be triggered when the CustomerJourneySummary is made available? 

 

I attempted to use both the ATTRIBUTED_SESSIONS_FIRST and ATTRIBUTED_SESSIONS_LAST webhook subscriptions, however neither are triggered when the CustomerJourneySummary is finally updated.

 

Currently the only work around is to continually retry for this information for 48 hours before giving up and considering it to be a null value. This is highly inefficient and requires us to continually poll for a result based on an unbounded time constraint.

Replies 3 (3)

jjdinho
Shopify Partner
3 0 1

Any update on a solution for this predicament? We are experiencing something similar.

shad0w_dom
Shopify Partner
1 0 0

We are also running into this same issue. I really hoped the order update webhook would be triggered once the data was added but it isn't. Any updates on a better way to do this than manually polling?

ShopifyDevSup
Shopify Staff
1453 238 508

Hello all - thanks for getting in touch. At the moment, there isn't a specific webhook topic that triggers once the customerJourneySummary fields are completely recorded. However, the 48-hour window mentioned in the documentation is usually the longest it should take. In most cases, the data should be available within a minute or so after the order takes place. As a workaround, you may want to implement an exponential backoff strategy starting 5 minutes from the order. 

For example, you could start with a 5-minute delay, then retry after 10 minutes, then 20 minutes, and so on, until the data becomes available or a maximum number of retries is reached. This is still polling, but it might help reduce the amount of calls you're sending out if that was a concern. 

In the meantime, I'm going to submit a report on my end to our product team regarding your reports here. I can't guarantee that there will be a webhook implemented or what a solution may entail/if there will be one implemented, but I will pass a note along to our developers on this. I can definitely understand how this can be frustrating for sure. Thanks again for bringing this up here - hope this helps.


Al | Shopify Developer Support

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us 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