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.