Home / Guides

Shopify analytics without cookies: add LightMetrica to your store

Updated: October 14, 2026

Shopify's own analytics is built around sales. If you also want a clear, cookie-free view of traffic — which sources bring visitors, which products and collections they open, how many people arrive from AI assistants — LightMetrica adds that in a few minutes.

What you need

<script defer src="https://lightmetrica.com/lm.js" data-site="YOUR_ID"></script>

If your store also opens on a myshopify.com address, add the domain you actually use for customers.

Add the code to your theme

  1. In Shopify admin, go to Online Store → Themes.
  2. Next to your current theme, click ⋯ and choose Edit code.
  3. Under Layout, open theme.liquid.
  4. Paste the code just before the closing </head> tag.
  5. Click Save.

If you switch to a new theme later, add the code to it as well.

What LightMetrica tracks — and what it doesn't

Your theme code runs on the storefront: home page, collections, product pages, cart, blog and other pages. That's what LightMetrica counts — visits, sources, popular products and pages, devices and countries.

Checkout pages don't run your theme code, so LightMetrica doesn't see the checkout steps or completed orders. Keep using Shopify's reports for sales and revenue; use LightMetrica to understand the traffic that leads to them.

Check that it works

Open your store on your phone, then check the Real-time report in LightMetrica. To keep your own visits out of the stats, open the store once with ?lightmetric=ignore at the end of the address.

FAQ

Will it slow down my store? No noticeably — the script is about 2 KB and loads with defer.

Can I see which marketing channels bring buyers? LightMetrica shows which sources bring visitors and how they behave. Revenue by channel stays in Shopify's reports. Tag your campaign links with the UTM builder so both tools see them clearly.

Does it count visits from ChatGPT and other AI assistants? Yes — they're grouped as a separate source, with no setup.

Try LightMetrica — free

Lightweight, independent, cookie-free analytics: the counter installs in a minute — on its own or next to your current tools. Every week — an AI-powered Smart Report: what changed and what to do next.