All things Shopify and commerce
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.
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.
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-trac... 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.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024