Tallyhouse Notes

Home › Setup & Migration › Install Cookieless Analytics Script: Setup and Test Guide

Install Cookieless Analytics Script: Setup and Test Guide

Editorial team · Updated 2026-10-14 · 5 min read

Installing a cookieless analytics script takes one tag in the head of every page, then a short test. The part that goes wrong is not the tag. It is duplicate installs, single-page apps that never fire a second pageview, and checkout pages on another domain.

What you need before starting

  • Access to your site’s template or tag manager.
  • The site ID or tracker ID from the tool.
  • The domain you want to register, so that traffic from other origins is rejected.
  • A private browser window for testing.

The basic install

Most tools give you a snippet like a <script defer src="..." data-...> tag. BusinessMCP’s tracking script documentation describes exactly that: one defer tag in the <head>, loaded with your data-tracker ID, with platform guidance for Google Tag Manager, WordPress via functions.php, Shopify via layout/theme.liquid, Webflow, Framer, Next.js App Router, Nuxt, Astro, SvelteKit and plain HTML. The same page says the script is cookieless, stores a visitor ID in localStorage, is under 30 KB gzipped and sends events with sendBeacon so it does not delay page load or unload.

Key takeaway: one tag, on every page, once. Duplicate tags are the most common source of inflated numbers.

Platform notes

Platform Where the tag goes Watch out for
Plain HTML In each page head, or a shared include Pages missing the include
WordPress Theme header hook or a header-injection method Caching plugins serving old HTML
Shopify Theme layout file Checkout runs on its own domain, so record purchases server-side
Webflow or Framer Site-wide custom code in head Publish after saving
Next.js or Nuxt Root layout component Route changes in the client router
Tag manager A custom HTML tag firing on all pages Also hard-coding the tag

If you hit Shopify, note the vendor-documented limit: the checkout domain differs, so purchases there should be recorded with a server-side goal endpoint rather than the browser script. Read more on server-side tracking if you go that way.

Single-page apps

In a single-page app, navigation changes the URL without a full page load. A good script hooks the History API so route changes count as pageviews. The BusinessMCP documentation says it hooks pushState, replaceState and popstate, counts hash changes only when data-hash="true" is set, and ignores query-string-only changes. Whichever tool you use, test: click through three routes and confirm three pageviews appear.

First-party loading

Ad blockers often target well-known analytics hostnames. Serving the script from a subdomain of your own site avoids that for many users. In BusinessMCP’s setup, you add a CNAME for a subdomain such as link.yourdomain.com, and after DNS propagates the tracking moves to that subdomain. Read the first-party analytics and ad blockers article for what that does and does not change.

If you want events held until consent, many tools offer a switch. In BusinessMCP, data-require-consent="true" holds all events until mcph.consent('granted') is called, and data-require-consent="split" sends base analytics while gating identification and recordings. Another attribute, data-respect-dnt="true", makes the tracker exit for visitors sending Do Not Track or Global Privacy Control, off by default. Decide with your legal advisor which mode fits, using analytics without a cookie banner as background.

Test checklist

  1. Open a private window and load your homepage.
  2. Look at the tool’s live view; the visit should appear within a minute or two.
  3. In browser developer tools, open the Application tab and confirm no tracking cookie was set.
  4. Open the Network tab and confirm one analytics request per page, not two.
  5. Click through a multi-page journey and a single-page route change.
  6. Trigger one goal and confirm it records.
  7. Check mobile by loading on a phone over mobile data.

Troubleshooting

  • No data at all: wrong site ID, or the page origin does not match the registered domain. BusinessMCP’s guide names both as the first things to check.
  • Double counts: two tags. Search templates and tag managers.
  • Missing pages: the tag is not in a shared layout, or a cache is serving old HTML.
  • Missing conversions: the goal fires before the page navigates away and gets dropped, or happens on another domain.

After install

Define your three most important goals and name them clearly. Then write down the date of installation in your change log, so that trend breaks in your reports have an explanation later. The pre-launch checklist covers what else to confirm.

Two more cases worth testing

Subdomains and multiple domains. If your marketing site is on www and your app or booking page is on another subdomain, check whether visits should be treated as one site. Some tools require registering each domain, and BusinessMCP’s script verifies the origin against your registered domain, per its web analytics documentation. Test a journey that crosses from one to the other and see whether the second visit counts as a new visitor.

Server-side goals. Some conversions never run in the browser, such as an invoice paid after a bank transfer or a subscription renewed by a payment provider. Send those from your backend. BusinessMCP documents server-side goal and identify calls, and its conversion goals documentation describes how goals are named and given a role. Whatever the tool, name goals clearly and keep a list of where each one fires.

Rollback plan

Before you ship the tag sitewide, note how you will remove it: the exact file, the commit, and who can do it. If a script misbehaves, such as slowing a page or breaking a layout, a one-minute rollback beats an hour of debugging in production. Keep the previous version of your header template handy, and test on a staging copy where you can.

Notes for WordPress and other CMS users

Content management systems add their own wrinkles, mainly caching and theme updates. If you run WordPress, the dedicated walkthrough in privacy friendly analytics for WordPress covers child themes, header injection and cache purging. Whatever platform you use, put the tag in a place that survives updates, document where it lives, and retest after every major theme or plugin update. A tag that quietly disappears during an update can leave a hole in your data that nobody notices for weeks, because dashboards show lower numbers rather than an error.

Frequently asked questions

How do I install a cookieless analytics script?

Add the vendor’s script tag to the head of every page, confirm the site ID, load a page, then check that the dashboard shows the visit.

Where does the analytics script go?

In the head of each page, usually with defer so it does not block rendering. Platforms such as WordPress and Shopify have theme files for this.

How do I check that analytics is working?

Visit your site in a private window, then look for the visit in the tool’s live view or overview. Also check the browser network tab for the request.

Why am I seeing double pageviews?

Usually the tag is installed twice, for example in the theme and in a tag manager. Keep one.