Shopify reference parameter does not work

Topic summary

Core Issue:
Developers are unable to track referral sources for Shopify orders. When adding a ?ref= parameter to product URLs, the expected referral data appears as null or empty strings in order webhook payloads.

Fields Returning Null/Empty:

  • reference
  • referring_site
  • landing_site (shows /admin/auth/login instead of actual landing page)
  • source_url
  • landing_site_ref

Proposed Workaround:
One user suggests implementing a custom cookie-based tracking system:

  • Generate referral links with unique identifiers (/product?ref=XXXXX)
  • Set a cookie via JavaScript when customers visit through referral links
  • Track orders using this cookie data instead of relying on Shopify’s native fields

Current Status:
Multiple users confirm experiencing the same problem. No definitive solution has been identified, and the discussion remains open with developers seeking alternative approaches to achieve referral tracking functionality.

Summarized with AI on November 14. AI used: claude-sonnet-4-5-20250929.

I am trying to make a referral management app and want to track from which referral the order is coming from. I have registered the order creation webhook. The data coming from the order has these following fields which may be useful but their response is either null or “” or something that is not useful to me.

        referring_site: '',
        landing_site: '/admin/auth/login',
        reference: null,
        user_id: null,
        source_identifier: null,
        source_url: null,
        landing_site_ref: null

I am expecting a reference here because I added /?ref= at the end of the URL when ordering a product. How should I proceed to achieve my objective? There is also a way in which whenever a customer visits using the referral link, we can add a cookie. And whenever he places an order we can track using this cookie? But how? There is nothing like a cookie field coming from webhook.

  1. Referral Link Generation: When generating referral links, append a unique identifier or token to the URL, such as /product?ref=XXXXX. This unique identifier will help you associate the referral with a specific customer.

  2. Tracking Cookies: When a customer visits your website using a referral link, you can set a cookie in their browser to track the referral. This can be done using JavaScript. For example:

document.cookie = "referral_token=XXXXX; expires=Fri, 31 Dec 2023 23:59:59 UTC; path=/";

I also have the same problem. From my understanding from here https://help.shopify.com/en/manual/orders/status-tracking/customize-order-status/add-conversion-tracking we can pass any value in the product ref param (e.g. https://[shop-name].myshopify.com/products/[product-name]?ref=[unique-ID]) and it’ll be forwarded to webhooks (I’m listening to orders/paid to be precise). However, what I get in landing_site_ref is always null.