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.
I am expecting a reference here because I added /?ref=<randomStr> 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.
landing_site_ref is ideal for this. If a customer enters your store at your-store.myshopify.com?ref=hello, landing_site_ref will be set to hello. This isn't restricted to the homepage either, for example your-store.myshopify.com/products/test?ref=hello will also work.
Keep in mind this is set when a customer first enters your store. So if they have been to your store previously (without a ref parameter), landing_site_ref will be null. This could explain your webhook results. Try placing a test order in a new incognito window (so landing_site_ref is reset).
landing_site - where the customer first arrived (e.g. "/products/avocado?ref=hello")
landing_site_ref - just the ref value (e.g. "hello")
referring_site - the url of the referrer that brought the customer to your store
source_identifier - used if the order is placed via POS
user_id - the ID of the user logged into POS
source_name - where the order originated (e.g. "web" or "pos")
I have tried this and am unable to get the required parameter, here is the flow I am using
On a side note I have also tried all permutations of the url
Based on https://help.shopify.com/en/manual/orders/notifications/email-variables the landing_site_ref makes sense, but in all my testing it never produces a value inside the webook
I am running a development store with a webhook posting to a requestbin and I can see the result of the order.created webhook, I can simply never get landing_site_ref to have a value
Your help would be greatly appreciated