highseat package renders the tracker’s script tag and gives you a typed track(). The tracker loads from cdn.highseat.com, so the install needs no secret and no server code.
Replace YOUR_SITE_ID with your site’s id, which starts with site_. Site settings › Installation in the dashboard shows it, with this code already filled in.
1
Install the package
2
Render it once, beside your root component
#/pricing, needs hashRouting on the component.
Deploy, then verify your install. Highseat counts only your site’s own domain, so a visit to localhost does not complete the install.
Use an environment variable
Read the site id from VITE_HIGHSEAT_SITE, set for the build: Vite writes it into the bundle. With another bundler, use its public prefix..env
Read the site id at runtime
A build-time variable writes one site id into the bundle. An app that ships one build to many installs, such as a self-hosted app’s Docker image, would then report every install to your site. Read the id from the server at runtime instead: each install sets its own id, or none. With no id, the component renders nothing, so no script loads and nothing is sent.server.ts
src/analytics.tsx
inject({ site }) from highseat once the server’s answer names a site.
Pages that are not found
A 404 the server answers is detected on its own. A single-page app also calls track(“404”), imported from highseat, in the component its router renders for an unknown route.Content Security Policy
Allow the ingest host in script-src and connect-src.Without the package
Add the tag to the<head> of index.html, the page Vite serves. Never render it from a component: a <script> tag that React creates in the browser never runs.
Next steps
Track events
Send signups and purchases with a typed
track().