Skip to main content
Tracking script for custom integrations

How to add the tracking script for custom integrations.

Admetrics avatar
Written by Admetrics
Updated over 3 weeks ago

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>

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.

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>

Enable advanced integration features like Predictive Audiences and Server-to-Server (S2S) connections for Meta/Facebook and Outbrain. By adding specific attributes to your script tags, you can optimize conversion tracking and enhance data accuracy. Read the full article: Attributes for Pixels and S2S events

Did this answer your question?