Cross-Site Tracking
Set Up Cross Site Tracking
Email: hello@continue.co
This guide covers how to set up cross-site tracking between your Shopify store and your resale marketplace. The tracking system enables identity stitching, conversion attribution, and customer journey analytics.
Overview
The Continue tracking system works by:
ct.js script.This enables:
Google Tag Manager (GTM) Setup
1. Install GTM on your Shopify store
If you haven't already, add Google Tag Manager to your Shopify theme:
theme.liquid, add the GTM container snippet in the <head> section:<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
<!-- End Google Tag Manager --><noscript> fallback immediately after the opening <body> tag:<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->Replace GTM-XXXXXXX with your actual GTM container ID.
2. Create the Continue tracking tag
In your GTM workspace:
ct.js loader script (see ct.js Script Reference below).- replace
YOUR_ORG_IDwith your organisation id - please ask someone at Continue for this value
<script>
(function() {
var s = document.createElement('script');
s.src = 'https://api.continue.co/engagement/static/ct.js?orgId=YOUR_ORG_ID&endpoint=https://api.continue.co/engagement/api/external-tracking-event';
document.head.appendChild(s);
})();
</script>Shopify Custom Pixel Setup (Checkout Tracking)
Shopify's checkout is sandboxed — GTM tags don't fire there. Use a Custom Pixel to track checkout events.
1. Create the Custom Pixel
YOUR_ORG_ID with your organisation id) analytics.subscribe('checkout_completed', (event) => {
var aid;
try { aid = localStorage.getItem('__ct_aid'); } catch(e) {}
if (!aid) return;
var checkout = event.data.checkout;
var payload = JSON.stringify({
anonymousId: aid,
organisationId: 'YOUR_ORG_ID',
trackingEventType: 'ExternalPurchase',
clientUrl: window.location.href,
metadata: {
email: checkout.email,
orderId: String(checkout.order.id),
orderTotal: parseFloat(checkout.totalPrice.amount)
}
});
var blob = new Blob([payload], { type: 'text/plain' });
navigator.sendBeacon('https://api.continue.co/engagement/api/external-tracking-event', blob);
});
analytics.subscribe('product_added_to_cart', (event) => {
var aid;
try { aid = localStorage.getItem('__ct_aid'); } catch(e) {}
if (!aid) return;
var item = event.data.cartLine;
var payload = JSON.stringify({
anonymousId: aid,
organisationId: 'YOUR_ORG_ID',
trackingEventType: 'ExternalAddToCart',
clientUrl: window.location.href,
metadata: {
originProductId: String(item.merchandise.product.id),
variantId: String(item.merchandise.id),
title: item.merchandise.product.title,
quantity: item.quantity,
price: parseFloat(item.merchandise.price.amount)
}
});
var blob = new Blob([payload], { type: 'text/plain' });
navigator.sendBeacon('https://api.continue.co/engagement/api/external-tracking-event', blob);
});Click Save and then Connect the pixel.
Troubleshooting
Make sure you've replaced YOUR_ORG_ID with your actual Continue organisation ID in the ct.js init script
Support
Need help with tracking setup? Contact the Continue team:
Email: hello@continue.co