Setup

Add one consent-gated snippet to a website, verify the installation, and TypeUI Insights automatically discovers every pathname where the tracker runs.

Requirements

  • A public HTTPS website
  • Access to the shared document <head>
  • An analytics-consent flow or consent-management platform
  • A TypeUI plan that includes Insights

Add the website

Open TypeUI Insights, choose Add website, and enter a name and public HTTPS origin. You can optionally associate the website with a TypeUI project.

Use the origin only, such as https://example.com, without a pathname, query string, or hash.

Install the tracker

On the website settings page, choose one of two installation paths:

  • Copy SETUP.md and give it to an AI coding tool.
  • Copy the code snippet and add it once inside the shared <head>.

SETUP.md tells the AI tool to make code changes only. It does not authorize deployment, publishing, hosting changes, or another production action.

The public snippet contains a site key and website-verification token. These identifiers are safe to include in a public website. It never exposes the TypeUI control secret, Cloudflare credentials, or another private TypeUI environment variable.

Call the public helper only after the visitor grants analytics consent:

Plain text
window.enableTypeUIInsights();

Call the withdrawal helper when the visitor revokes analytics consent:

Plain text
window.disableTypeUIInsights();

The external tracker is not requested before consent. If consent is withdrawn, collection stops and queued custom events are cleared.

If your website uses Content Security Policy, allow these production origins:

Plain text
script-src https://cdn.typeui.sh
connect-src https://collect.typeui.sh

Verify the installation

Return to the website settings page and choose Verify installation. TypeUI checks the registered homepage for its verification token and follows normal redirects between the apex and www host when appropriate.

If verification cannot reach the website, temporarily allow the TypeUI verification request through bot protection, a firewall, a challenge page, or a staging-password screen. You can restore the protection immediately after verification.

A verified badge is shown only after the token is found and the verification succeeds.

Test analytics collection

Open the website in a normal browser session, grant analytics consent, and visit a few pages. Data appears after the tracker starts a consented session and successfully sends events to the collector.

If the dashboard remains empty, check the browser developer tools:

  • Confirm that https://cdn.typeui.sh/insights/v1.js loads after consent.
  • Confirm that requests to https://collect.typeui.sh are not blocked.
  • Check Content Security Policy and ad-blocking extensions.
  • Confirm the installed site key belongs to the website you are viewing.
  • Confirm the registered origin matches the final public origin after redirects.

Review privacy guidance

Open the compliance step after verification and copy COMPLIANCE.md. It documents the current retention, data categories, excluded payloads, consent integration, heatmap-preview considerations, and customer responsibilities.

Keep the tracker off sensitive routes. Add data-typeui-ignore to individual elements whose clicks must not be measured.

What happens next

Every pathname where the consented tracker runs is discovered automatically. Traffic and engagement appear first; session journeys, scroll depth, and heatmaps fill in as visitors interact with the pages.

Campaign parameters and custom events use the same installed snippet: