Shopify Analytics Without Cookies
Add Fusionaly to a Shopify store by editing theme.liquid. It counts store pages, product clicks, and add to cart, with no cookies.
In Shopify, you add the Fusionaly script to the layout of your theme, theme.liquid. Fusionaly then counts every page of your store that uses the theme.
Before you start
You need a Fusionaly server, with your site's domain added as a website. Fusionaly takes events only from the domains you added. See Installation.
In the examples, replace analytics.example.com with the domain of your Fusionaly server.
Add the script
-
In the Shopify admin, open Online Store > Themes.
-
Next to your live theme, click …, then Edit code.
-
Open
layout/theme.liquid, and add the script just before</head>:layout/theme.liquid <script defer src="https://analytics.example.com/y/api/v1/sdk.js"></script></head>
Add the domain that your customers visit as a website in Fusionaly. If they also open the myshopify.com address, add that domain too.
Page changes
Shopify themes load each page in full, so Fusionaly counts each page without any setup.
Track events
Fusionaly counts page views and button clicks without any setup. To give an event your own name,
use the data-fusionaly-event-name attribute. See Tracking.
Add the attribute to a button in your theme. Liquid can fill the metadata. For example, in the product form section:
<button type="submit" name="add" data-fusionaly-event-name="add_to_cart" data-fusionaly-metadata-product="{{ product.handle }}"> Add to cart</button>Check that it works
- Open your site in a normal browser window. Fusionaly skips automated browsers, such as Playwright, and browsers that send Do Not Track.
-
In the developer tools, open the network tab, and find a
POSTrequest to/x/api/v1/events. A 403 status means that your site's domain is not added as a website. - Open your Fusionaly dashboard. The visit shows up within about a minute.
Notes
- Shopify runs the checkout, the thank-you page, and the order status page outside your theme. Fusionaly does not see these pages, so it does not count purchases on its own.
- The edit belongs to this theme. If you publish another theme, add the script to it, too.
Next steps
- Revenue Tracking: count purchases and their amounts.
- Section Tracking: count the sections that visitors see.
- Exclude your own visits: stop counting your own browser.
- AI Clients (MCP): ask Claude Code, Codex, or Cursor about your traffic.
Guides for other frameworks: Next.js, React, Astro, Nuxt, SvelteKit, WordPress, Webflow, Ghost, Hugo, and the generic guide.