On Shopify, the snippet goes into your theme's main layout, which every storefront page uses. Checkout runs outside your theme, so this guide also shows how to count the step into checkout.
1. Add your store with the domain your customers use
trackr.link records hits only from the site's domain and its subdomains. When you add the store in trackr.link, use its customer-facing domain, such as shop.example.com. Visits on the store's myshopify.com address and theme previews there are not counted, unless that is the domain you added.
2. Copy your snippet
Open the site in trackr.link and copy its snippet. It looks like this, with your own site id:
<script defer data-site="YOUR_SITE_ID" src="https://pulse.trackr.link/t.js"></script>
3. Add it to the theme
- In Shopify admin, go to Online Store, then Themes.
- Next to your live theme, open the ⋯ menu and choose Edit code.
- Open
layout/theme.liquid. - Paste the snippet just before
</head>and save.
The snippet lives in that theme only. When you publish a different theme, or a fresh copy of a theme from the Theme Store, add it again.
4. What the snippet can see
The theme covers the storefront: the home page, collections, products, search, pages, blog posts and the cart page. The tracker records the path only, so /products/linen-shirt?variant=123 counts as /products/linen-shirt. UTM tags in the query are kept as campaign data.
Checkout and the order status page don't use theme.liquid, so the snippet doesn't load there. Purchases don't appear as pageviews, and you can't add a goal for the thank-you page.
5. Count the step into checkout
Count the click on the checkout button instead. Find the button in your theme's cart template. In Dawn and most themes built on it, it is in sections/main-cart-footer.liquid, plus snippets/cart-drawer.liquid if the theme has a cart drawer. Add a data-trackr-event attribute to each checkout button:
<button type="submit" id="checkout" class="cart__checkout-button button" name="checkout" data-trackr-event="checkout_start">
{{ 'sections.cart.checkout' | t }}
</button>
Then add an event goal for checkout_start in trackr.link, and a funnel from a product page (/products/*) to /cart to checkout_start.
Use the same attribute on other buttons that matter, such as a featured call to action, with a prop that names its place:
<a href="{{ collection.url }}" data-trackr-event="cta_click" data-trackr-prop-location="hero">Shop the collection</a>
6. Check that it works
Open your store in an ordinary browser window, on its own domain, and visit a few pages. Your dashboard opens when the first pageview arrives. Then add something to the cart and click the checkout button. checkout_start then shows up among the events on your dashboard.
7. Read your first visits
Every visit counts in a channel, such as Organic Search, Email or AI. Channels and UTM parameters lists the rules that decide which one, and AI traffic shows how visits from ChatGPT, Claude, Perplexity and other assistants are recognized. To tag the links you share in campaigns, use the UTM builder.