If you're using a non-standard (headless) Shopify website, some of Rep's automatic event tracking may not function correctly due to the custom structure of the site.
To ensure proper tracking, follow this guide to manually inject the required snippets—either through Google Tag Manager or by adding them directly to your website's code.
Important: Replace all placeholder values (marked in bold) with actual data extracted from your website.
Note: This requires coding knowledge.
Events:
Page Viewed event:
Trigger on every page load
<script> event = 'PRODUCT_VIEWED';
properties = {
"product_id" : {product_id},
"name" : {product_name},
"url" : window.location.href
};
(function (w, l) { w[l] = w[l] || [];
var d = {
et: event,
d: properties };
w[l].push(d);
}) (window, 'vfAnalytics');
</script>
Product Viewed event:
Trigger on every page load of a PDP
<script> event = 'PRODUCT_VIEWED';
properties = {
"product_id" : {product_id},
"name" : {product_name},
"url" : window.location.href
};
(function (w, l) { w[l] = w[l] || [];
var d = {
et: event,
d: properties };
w[l].push(d);
}) (window, 'vfAnalytics');
</script>
Product List Viewed event:
Trigger on every page load of a collection page
<script> event = 'PRODUCT_LIST_VIEWED';
properties = {
"list_id" : {collection_id},
"query" : window.location.search.replace("?", ""),
"product_group" : {collection_name},
"url" : window.location.href
};
(function (w, l) { w[l] = w[l] || [];
var d = {
et: event,
d: properties };
w[l].push(d);
}) (window, 'vfAnalytics');
</script>
Product Added event:
Trigger after a product is added to the cart
<script> event = 'PRODUCT_ADDED';
properties = {
"product_id" : {product_id},
"name" : {product_name},
"variant" : {variant_id},
"price" : {variant price},
"quantity" : {quantity},
"url" : window.location.href
};
(function (w, l) { w[l] = w[l] || [];
var d = {
et: event,
d: properties };
w[l].push(d);
}) (window, 'vfAnalytics');
</script>