InstallPlatforms
Shopify
Add trckable to a Shopify store through the theme, and count checkout with a custom pixel.
The script goes into your theme, so every storefront page carries it. Checkout runs on Shopify's own pages and is covered in the last step.
Steps
- In the Shopify admin, go to Online Store → Themes.
- On your live theme, click the ... button, then Edit code.
- Open layout/theme.liquid and find
</head>. - Paste the script tag on the line just before
</head>, then click Save.
<script
defer
data-site="tkb_a1b2c3d4"
data-domain="example.com"
src="https://stats.example.com/js/tkb_a1b2c3d4.js">
</script>Checkout pages are not part of your theme. To count them too, go to Settings → Customer events → Add custom pixel, give it a name and paste the same script. Do not add it in both places for the storefront: a page would count twice.
Check it works
Open your site in a private window, then open your trckable dashboard and look at Live. Your visit shows up within a minute.
If it does not show
- A different theme is live than the one you edited. Check which theme says Current theme, and edit that one, or edit the code again after switching themes.
- The store is password protected. Visitors are sent to the password page, which has no tag. Remove the password, or open the store as a visitor with the password.
- A new theme version replaced
theme.liquid. Add the line again after theme updates.
Still stuck? Run npx trckable doctor against your site, or see the script tag page.