Start here

Install on Shopify

Paste the script in your theme, add a customer-events pixel for revenue.

1. Add the tracking script

In Shopify admin: Online Store → Themes → on your current theme click ⋯ (or Actions) → Edit code. Open layout/theme.liquid, find the closing </head> tag, and paste these lines just above it. Save.

Your token is on your site’s page in the Asuito dashboard. The last line is what connects activity to logged-in customers — Shopify fills in the customer number itself, and no name or email is ever sent.

html
<script>window.spx=window.spx||function(){(window.spx.q=window.spx.q||[]).push(arguments)}</script>
<script defer src="https://asuito.com/px.js" data-token="YOUR_SITE_TOKEN"></script>
{% if customer %}<script>window.spx('identify', 'shopify_{{ customer.id }}');</script>{% endif %}

2. Record every sale — no code

Shopify tells Asuito about each paid order directly, and setting it up is clicks, not code:

1. In Shopify admin: Settings → Notifications → Webhooks → Create webhook. Choose the event Order payment, format JSON, and paste the address from your Asuito site’s Settings → Revenue card (owners only) as the URL.

2. On that same Shopify page, below the webhook list, Shopify shows the signing secret your webhooks are signed with. Copy it.

3. On your Asuito Settings → Revenue card, pick Shopify and paste that secret. The signature is what proves each order really came from your store.

From then on every paid order lands in the Revenue tab with its real amount and currency — including orders from other sales channels and Shopify POS, which no browser script could ever see. Currencies are recorded, never converted: a store selling in two currencies sees two honest totals.

Sales are credited to the same customer the theme snippet identifies, so revenue per customer works without anything passed through checkout.

What Shopify cannot do

AI crawler tracking needs code that runs on the server before a page is answered, and Shopify does not let anyone run code there. If your domain sits behind Cloudflare, the Worker snippet on your dashboard’s Crawlers tab works; otherwise this one feature is not available on Shopify, and it is better to say so than to pretend.

If you switch themes

The script lives in the theme you edited, so a new theme needs the same paste again. The customer-events pixel is store-wide and survives theme changes.