Conversion Tracking

To track purchase conversions in Shopify, a JS snippet must be added to the order status page.

To do this, copy the Javascript snippet below, and paste it into your order status page ‘additional scripts’ box. This is found on the ‘Settings > Checkout’ page under ‘Additional scripts > Order status page’. Be careful not to overwrite any code which may already be present in the box. More information about conversion tracking is available in Shopify’s documentation.

{% if first_time_accessed %}
        document.addEventListener("boonload", function(e) {
            boon('feedback', 'purchase', [{{ line_items | map: "variant_id" | join: "','" | prepend: "'" | append: "'" }}]);
{% endif %}

Because the snippet is wrapped in an if first_time_accessed block, conversions will only be tracked when the user first loads the order confirmation page. The snippet will then track the Shopify line_items which were purchased by the user.

Your ‘additional scripts’ box should look similar to the following:

Example Shopify additional scripts screenshot