Shopify storefront
Updated 2026-11-02
What works and what doesn't
A script tag works in your Shopify theme, so you get traffic reports, funnels, goals, heatmaps and form capture on storefront pages.
Shopify support stops there:
- The script doesn't run on Shopify's checkout.
- Headstream doesn't read Shopify orders.
- Revenue attribution works from Stripe only. Sales paid through Shopify won't appear, unless those payments are in a Stripe account you connect.
Use this setup if you want traffic and funnel data for the store. If you need order revenue by channel, Headstream won't give you that on Shopify today.
Setup
- Copy your snippet from Project settings in Headstream.
- In Shopify admin, go to Online Store, then Themes.
- On your live theme, open the menu and choose Edit code.
- Open
layout/theme.liquid. - Paste the snippet just before
</head>, and save.
<script
defer
src="https://headstream-ingest.super-dream-7005.workers.dev/t.js"
data-key="YOUR_KEY"
></script>
Add your domains
Add your custom domain to the project. If visitors also reach your myshopify.com address, add that too, under Project, in the Domains card.
Track store events
A theme can send events with the script. For example, count add to cart submissions:
<script>
document.addEventListener("submit", function (event) {
if (event.target.matches('form[action*="/cart/add"]')) {
window.headstream?.track("add_to_cart");
}
});
</script>
Then make add_to_cart a step in a funnel. The last step you can measure is on the storefront, such as /cart. Nothing after that is visible to the script.