Skip to main content
An Astro site loads the tracker with one tag in its layout, static or server-rendered. The tag starts the tracker before any page script runs, which inject() from the package cannot do: it runs only once the bundled scripts load. 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

Add it to your layout

In the <head>. is:inline keeps Astro from bundling it, so the tracker starts before any page script.
src/layouts/Layout.astro
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 PUBLIC_HIGHSEAT_SITE, set for the build: Astro writes it into the page.
.env

Content Security Policy

Allow the ingest host in script-src and connect-src.

Track events with the package

Install the highseat package for a typed track() in your page scripts. It sends through the tracker your layout loads, and a call made before the tracker has loaded waits for it.

Next steps

Track events

Send signups and purchases with a typed track().