Shopify

Track your Shopify store with real-time analytics

Skip the GA4 setup ordeal. Drop the HitCounters snippet into your theme and watch live visitors, referrers, and engagement.

Get tracking code See live demo

Step-by-step

  1. Sign up at HitCounters
    Create a free account, add your Shopify domain (e.g. yourstore.myshopify.com or your custom domain), and copy your 16-character tracking code.
  2. Open your theme code editor
    In Shopify admin, go to Online Store → Themes. On your active theme, click Actions → Edit code.
  3. Open <code>theme.liquid</code>
    Under the Layout folder, click theme.liquid. This is the master template that wraps every page.
  4. Paste the snippet before <code>&lt;/head&gt;</code>
    Find the closing </head> tag (usually around line 30-50) and paste this just before it. Replace YOURCODE with your actual tracking code:
    <!-- HitCounters.com -->
    <script async src="https://hitcounters.com/api/tracker.js?code=YOURCODE"></script>
    <noscript><img src="https://hitcounters.com/api/track.php?code=YOURCODE&noscript=1" alt="" style="display:none;"/></noscript>
  5. Save and verify
    Click Save in Shopify, then return to your HitCounters Sites page and click Verify. Your live dashboard will start filling in within seconds.

Alternative: paste via Shopify Apps (no code)

If you don't want to touch theme code, use a free header/footer code app like "Code Snippets" or "Header Footer Code Manager". Paste the snippet in the Header section, save, and verify.

FAQ

Will this slow down my Shopify store?
No. The tracker is async, doesn't block rendering, and weighs under 25 KB. Shopify's own performance tools won't flag it.
Will it track checkout pages?
Shopify's native checkout is on a separate domain (checkout.shopify.com) and the snippet won't fire there. For checkout tracking, use Shopify's additional scripts feature on a paid plan, or set a URL goal for /orders/ or thank-you redirects.
Can I track add-to-cart events?
Yes. Use our hcEvent('add_to_cart', value) JS API. Add it to your theme's product form via a snippet or via Shopify's custom JS. Define a matching Event goal on the Goals page.
Does it work with Shopify 2.0 themes?
Yes — both legacy and Online Store 2.0 themes use theme.liquid the same way.

Ready to track your Shopify site?

Free plan, no credit card required. Setup takes 2 minutes.

Sign up free See live demo