Skip to content

Tracking setup

General Tracking

The Hello Retail JavaScript must be included on all pages of the webshop. For optimal load speed, the script should be added to the header section. This will handle the view & click tracking.

<script async src="https://helloretailcdn.com/helloretail.js"></script>
<script>
    window.hrq = window.hrq || [];
    hrq.push(['init', {}]);
</script>

We do also support server-side tracking.

Single Page Applications (SPA)

For Single Page Applications (SPA), you need to call the script's reload endpoint whenever significant page content changes—most commonly when the URL changes. Use the following method after the new content is available in the DOM:

hrq = window.hrq || [];
hrq.push("reload");

Conversion and Cart Tracking

While the Hello Retail script automates most tracking, it requires some input for conversion and cart tracking. This is done by using our JavaScript SDK. Ensure that the Hello Retail script is loaded and ready before making API calls. You can find detailed documentation on event binding here. Examples of its usage are available in the conversion & cart tracking documentation.

Conversion Tracking

Conversions should be tracked when an order is completed, typically on the order receipt or confirmation page. Refer to the JavaScript SDK documentation.

Cart Tracking

Cart tracking must occur whenever there is a change to the cart, regardless of the page the customer is on. Alternatively, for simplicity, you can update the cart on every page load. Read more here

Note: If a variant product is added to the cart, ensure that the ProductData reflects the variant details.