← Starting Page

← How to enable tracking and consent

<aside> 💡 Written by Marina Koch, last updated on 21st of October 2024

</aside>

<aside> 🎓

What you will learn in this article:

1. Setup tracking script on all pages

In case you run another shop system or website you need to add the following snippet to all pages (between <body> and </body> tag). Before adding the script, you need to replace the [SHOP_ID]with your specific shop ID and dynamically replace {{ CUSTOMER_ID }} with the customer ID (if available), alternatively you can set {{ CUSTOMER_ID }} to an empty string.

<script id="js-app-admq-data" type="application/json">
{
    "sid": "[SHOP_ID]",
    "cid": "{{ CUSTOMER_ID }}"
}
</script>
<script id="js-app-admq-script"
        type="application/javascript"
        src="<https://shopify.admetrics.events/conversion-v1.min.js>"
></script>

<aside> 💡 To retrieve the shop ID on Shopify you can go to https://YOURSHOP.myshopify.com/shop.json and search for "shopId". The number behind it is your shop ID.

</aside>

2. Set up conversion tracking

Add the following snippet to your order confirmation/status or thank_you page. Before adding the script, you need to replace the [SHOP_ID]with your specific shop ID.

You need to dynamically fill in {{ ORDER_ID }} with the order ID, {{ CUSTOMER_ID }} with the customer ID (if available). Alternatively you can set {{ CUSTOMER_ID }} to an empty string. You also need to replace {{ ORDER_NAME }} with the name of the order, or alternatively set it to the {{ ORDER_ID }}.

<script id="js-app-admq-data" type="application/json">
{
    "sid": "[SHOP_ID]",
    "oid": "{{ ORDER_ID }}",
    "cid": "{{ CUSTOMER_ID }}",
    "on": "{{ ORDER_NAME }}"
}
</script>
<script id="js-app-admq-script"
        src="<https://shopify.admetrics.events/conversion-v1.min.js>"
></script>