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:

  • Dropping a first-party cookie on your main Shopify store via the ct.js script.
  • Reading that cookie on the marketplace to stitch customer identities across domains.
  • Firing tracking events at key touchpoints (page views, add-to-cart, checkout) via Google Tag Manager (GTM) and Shopify Custom Pixels.
  • This enables:

  • Attribution of marketplace conversions back to the original store session.
  • Customer journey mapping across store → marketplace → purchase.
  • Cohort analysis and LTV reporting in the Continue dashboard.

  • Google Tag Manager (GTM) Setup

    1. Install GTM on your Shopify store

    ⏭️
    Already have GTM installed? Skip to step 2.

    If you haven't already, add Google Tag Manager to your Shopify theme:

  • Go to Online Store > Themes > Edit Code.
  • In theme.liquid, add the GTM container snippet in the <head> section:
  • html
    <!-- 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 -->
  • Add the <noscript> fallback immediately after the opening <body> tag:
  • html
    <!-- 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:

  • Go to Tags > New.
  • Name it Continue Cross-Site Tracking - Page View
  • Choose Custom HTML tag type.
  • Paste the ct.js loader script (see ct.js Script Reference below).
    1. replace YOUR_ORG_ID with your organisation id - please ask someone at Continue for this value
  • typescript
      <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>
  • Set the trigger to All Pages.
  • Save and publish.

  • 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

  • In your Shopify Admin, go to Settings > Customer events.
  • Click the Custom pixels filter.
  • Click Add custom pixel.
  • Name it Continue Checkout Tracking.
  • Paste the following code (replace YOUR_ORG_ID with your organisation id)
  • javascript
      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