Install cookieless analytics on a Shopify storefront
Load the browser bundle in an Online Store theme for storefront pageviews and custom actions. Checkout, customer-account, and order tracking require separate platform-specific integration.
Prepare the SDK from source
The SDK package is currently private and unpublished. Clone its repository and build the browser bundle. The source repository uses pnpm; application integration examples below use npm. Pin a reviewed commit for a production deployment.
Build the source and a local package archive
git clone https://github.com/yosriady/untitled-analytics-sdk.git
cd untitled-analytics-sdk
pnpm install
pnpm build
pnpm packAdd the bundle to the theme
Upload dist/snippet.global.js as a theme asset in a development or duplicate theme first. Register the actual storefront origin. This guide targets Online Store themes, not headless storefronts or Shopify’s checkout sandbox.
Keep storefront events separate from payment truth
Track named actions only when the app confirms them. A purchase revenue event should come from a verified purchase path, not a guessed thank-you-page view. The current guide does not implement an order webhook, Customer Events pixel, refund import, or cross-domain checkout linkage.
Theme scripts do not run everywhere that a customer can complete checkout or access an account. Follow Shopify’s customer privacy requirements for your actual configuration, especially for optional identity and replay.
Verify pageviews and custom events
Register your actual site origin and use its public SDK write key. The endpoint is your deployed API origin, not a Tinybird URL. Open the published site, check that the bundle loads, and inspect successful collector requests and the project activity feed. Collection is queued, so allow for delivery latency.
Trigger a second page and a custom event. Confirm one expected pageview per navigation. Disable duplicate analytics installations. Identify an account only after login and clear the SDK user ID at logout. Review campaign fields, properties, and optional replay on a non-sensitive page first.
Frequently asked questions
Is the npm package public?
No. Build from source and install the local archive, or host the built browser bundle. Do not assume npm install @untitled-analytics/web resolves yet.
Which endpoint do I use?
Use your deployed analytics API origin, such as https://api.your-domain.com. Do not expose Tinybird or database credentials in browser code.
How do I check installation?
Verify bundle loading and successful collector requests, then inspect the project activity feed for the page and a named test event.