GuidesWeb

Shopify analytics, cookieless and EU-hosted

Paste one snippet into your theme and your store is tracked.

Privytics adds page-view analytics to any Shopify store with one snippet you paste into your theme. There is no app to install and no coding. Most Shopify stores add Google Analytics, which needs a cookie banner for EU visitors, while Privytics is cookieless and EU-hosted, so there is nothing to consent to. This guide covers your storefront pages, which is where most of your traffic lives.

Why Shopify teams use Privytics

One snippet, no coding

You paste a single snippet into your theme and save. No app to install, no developer, and no files to manage.

Nothing is written to the device

The snippet sets no cookies and stores no identifier in the browser. Visitors are counted with an anonymous id that resets every day.

Your data is stored in the EU

Your analytics event data is stored in Germany, and Privytics runs the open-source OpenPanel engine. You remain the data controller.

Works on every Shopify plan

The storefront snippet lives in your theme, so it runs on Basic, Shopify, Advanced and Plus. No paid tier is required to start.

Set it up

About five minutes, on the free plan, without a credit card.

  1. Open your theme's head area

    In your Shopify admin, go to Online Store > Themes. Click the three dots next to your live theme and choose Duplicate first, so you always have a backup. Then on your live theme click the three dots again and choose Edit code. Under Layout, open theme.liquid and scroll down to the line that says </head>. This works on every Shopify plan.

    Online Store > Themes > (Duplicate) > Edit code > Layout > theme.liquid
  2. Paste the snippet and replace your client id

    Paste the two tags below on the line just before </head>. Replace YOUR_CLIENT_ID with the client id from your Privytics project, then click Save. Shopify can take a moment to refresh, so wait a few seconds before you check.

    <script>
      window.op=window.op||function(){var n=[];return new Proxy(function(){arguments.length&&n.push([].slice.call(arguments))},{get:function(t,r){return"q"===r?n:function(){n.push([r].concat([].slice.call(arguments)))}} ,has:function(t,r){return"q"===r}}) }();
      window.op('init', {
        apiUrl: 'https://api.privytics.com',
        clientId: 'YOUR_CLIENT_ID',
        trackScreenViews: true,
        trackOutgoingLinks: true,
      });
    </script>
    <script src="https://privytics.com/op1.js" defer async></script>
  3. Check that page views are arriving

    That is the whole setup. Open your store in a new tab and click through a couple of pages. Page views are tracked automatically, so within a few seconds you will see them in your Privytics dashboard under Realtime.

    Open your store, then watch Privytics > Realtime
  4. Optional: track one button click

    Want to count a specific action, like opening a size guide? In the theme editor go to Online Store > Themes > Customize, add a Custom Liquid block where you want it, and paste the button below. Each click sends one event named size_guide_opened. Page views already work without this, so this step is optional.

    <button onclick="window.op('track', 'size_guide_opened')">Size guide</button>

Questions

Do I need a paid plan for this?

No. The free plan covers 10,000 events a month with no card, and the storefront snippet works on every Shopify plan. Paid plans add higher event limits, 5 years of event history and session replay when you need them.

Do I still need a cookie banner?

The snippet writes nothing to the device and sends no cookie, so for the anonymous case there is nothing to consent to. You remain the data controller.

Where is my data stored?

In the EU. Your analytics event data is stored in EU data centres in Germany.

Can I track button clicks or events?

Yes. Page views are automatic, and you can count a click by adding a Custom Liquid block that calls window.op('track', 'your_event'). Tracking checkout and purchases works differently and belongs to Shopify's Web Pixels API, so it is not covered here.