Shopify has a built in URL parameter that when used in a very specific way can help you track a visitor who was referred by someone all the way to the Thank You page.
The trick is that the ref parameter only works on the very first page load of the shop. In other words, this will not work if you try to use the ref parameter via an html img or iframe tag after the page has loaded.
That being the case, this basically means that the URL a visitor uses to come to the shop MUST have the ?ref=SOMEREFCODE at the end. i.e.: https://myshopifystore.com/products/myproduct?ref=x7T2z
That being the case, on the order status page, you could do something like this:
{% if landing_site_ref != blank %}
<script>
{% if landing_site_ref == ‘x7T2z’ %}
alert(‘{{ landing_site_ref }}’); // this will display the SOMEREFCODE
{% else %}
// do nothing or maybe something else. its up to you
{% endif %}
</script>
{% endif %}
Leave a Reply
You must be logged in to post a comment.