How to reliably attribute orders to custom links (short URLs / campaigns)?

I’m trying to attribute orders to specific incoming links (e.g. campaign URLs with tracking parameters) using the orders/create webhook.

However, I’m noticing:

  • landing_site and referring_site often reflect older sessions, not the latest visit.
  • Returning visitors clicking a new link still show the previous landing/referrer.
  • On dev stores, landing_site is always /password, and query parameters are stripped.
  • customerJourneySummary appears missing from webhook payloads, despite being in the Admin API docs.

What’s the best way to reliably attribute an order to a specific URL or referral source?

Appreciate any insights or best practices:)

You might not need to do this yourself as you can see this in Shopify analytics now. And so you could construct a query and link the merchant to that if possible, keeping it Shopify native.

Or it looks like those fields have been deprecated, you can get similar information from the customer journey on the order in GraphQL.
The deprecation notice recommends using the last visit field on here.
Order - GraphQL Admin