BusinessMCP
All docs

Install the tracking script

6 min read

How to install BusinessMCP’s cookieless, GDPR-friendly tracking script — the single required step that powers your unified analytics — plus goal and revenue tracking with mcph.track and mcph.identify.

Why the script matters

The tracking script is the foundation of your unified data platform. Everything the dashboard shows — visitors, conversion rate, revenue, leads, attribution — and everything an agent reads through get_analytics starts as an event from this script. That is why it is the *single required step* in onboarding: connect zero tools and you still get a real analytics platform; skip the script and there is no spine for the rest to hang on.

Install the snippet

Add one line to the <head> of every page you want measured:

<script defer src="https://businessmcp.com/track.js" data-tracker="YOUR_TRACKER_ID"></script>

Your real data-tracker id is shown in onboarding, on the Connections page, and on the Overview empty state — copy it from there. The script auto-tracks pageviews, including client-side route changes in single-page apps, and classifies each visit's channel, device and referrer for you. Origin is verified against your registered domain, so events only count from the site you own.

Track goals & revenue

For conversions, call mcph.track when something meaningful happens. Pass a goal name and, for purchases, a revenue amount in cents:

<script>
  // A signup completed
  mcph.track('signup')

  // A purchase worth $49.00
  mcph.track('purchase', { revenue_cents: 4900 })
</script>

Goals show up in your funnels and attribution so you can see which channels and campaigns actually drive revenue, not just traffic. Server-verified revenue from Stripe is attributed automatically through the checkout flow, so client-side revenue tracking is optional belt-and-suspenders.

Identify visitors

To stitch an anonymous visitor to a real person, call mcph.identify with an email once you know it (for example, right after signup):

<script>
  mcph.identify('jordan@example.com', { plan: 'pro' })
</script>

Identify events flow into the CRM rather than the raw analytics firehose, linking visitor_id → email → stripe_customer_id so a contact's full journey — first touch to lifetime value — lives in one place.

Beat ad blockers (custom subdomain)

The plain script tag above already works everywhere. But because it loads from a third-party domain, some ad blockers and privacy browsers drop it — which quietly undercounts your traffic. The fix is to serve the *same* tag from a subdomain of your own site so it looks first-party.

In onboarding and on the Connections page, switch the install card to the Custom subdomain tab and enter a subdomain you own — for example analytics.yourdomain.com. You will be given one CNAME DNS record to add at your domain provider:

Type:  CNAME
Name:  analytics   (the sub-label of your subdomain)
Value: <the target we show you>
TTL:   Auto (or 3600)

Once DNS propagates, verification flips to Verified on its own and we swap the tag's address automatically — there is no second script and no double-counting. This step is optional but recommended for the most accurate numbers.

Privacy & compliance

The tracker is cookieless and privacy-respecting by design. It mints a persistent visitor id in localStorage instead of using cookies, honors Do Not Track and Global Privacy Control signals, and does not fingerprint devices. Session hashing uses a daily-rotating salt, and geolocation is coarse (from request headers, not GPS). Because it stores no personal identifiers by default and sets no tracking cookies, most sites can run it without a consent banner — but confirm against your own legal requirements.

Verify events

After installing, load a page on your site and watch the live "receiving events" indicator in onboarding or Connections flip to active — that confirms events are landing. From there, open the Overview to see visitors and sessions populate. If nothing arrives, the usual culprits are a wrong data-tracker id or an origin mismatch (the script must run on your registered domain). Once events flow, you are done — the rest of BusinessMCP builds on top automatically.

Frequently asked questions

Do I really only need the tracking script?

Yes. It is the single required step in onboarding. Connectors and your MCP endpoint are optional extras — the script alone gives you the analytics spine that visitors, conversion, revenue and attribution are built from.

Does the tracker use cookies?

No. It is cookieless and GDPR-friendly. It mints a persistent visitor id in localStorage, honors Do Not Track and Global Privacy Control, and never fingerprints. You typically do not need a cookie banner for it.

Will it slow down my site?

No. The script is about 1KB, loads with defer, and sends events via non-blocking beacons so it never delays page load or unload.

Keep going

Turn your company into one AI-ready data platform on a single hosted MCP endpoint.