Install the tracking snippet
Copy your site's snippet from Boostra and paste it into the head of every page you want to measure.
Updated
Boostra measures your site with one script, t.js. You paste it once into your site's <head> and it starts sending pageviews and actions to your project.
Copy your snippet#
Every project has its own snippet with its own site key. Always copy it from the app instead of typing it:
- Open your project. The setup wizard shows it on the "Install tracking" step; later you find it in "Settings" under "Install tracking".
- Click "Copy snippet". The button changes to "Copied".
It looks like this, with your own values in place of the placeholders:
<script>window.boostra=window.boostra||function(c){var b=window.boostra;if(c==="ids")return{visitorId:null,sessionId:null,externalId:null};(b.q=b.q||[]).push(arguments)};</script>
<script
async
src="https://platform.getboostra.com/t.js?v=VERSION"
data-website-id="YOUR_SITE_KEY"
data-endpoint="YOUR_INGEST_ENDPOINT"
data-domain="example.com">
</script>The first, inline <script> is a tiny stub. It lets your code call window.boostra(...) before t.js has loaded; those calls are queued and replayed. The second tag loads the tracker async, so it never blocks your page.
Paste it#
Add the snippet to the <head> of every page you want measured. Paste it unchanged. In practice that means your site's shared layout or template:
- Frameworks (Next.js, React, Vue, Nuxt, Astro, Remix, Svelte): the root layout or the HTML template.
- Server-rendered apps (Express, Django, Laravel, Rails): the base layout template.
- Site builders (WordPress, Webflow, Framer, Wix, Squarespace, Ghost and others): the custom code or head code setting.
- Shopify: connect the store instead, see install Boostra on Shopify.
Boostra has no plugin or package for these tools: the same snippet works everywhere because it is plain HTML. Single-page apps need nothing extra, since route changes are tracked automatically.
If your app is on a subdomain such as app.example.com, paste the identical snippet there too. One site key covers the site and its subdomains. See subdomains and extra domains.
Confirm it works#
Deploy, then click "OK, I’ve installed" in the wizard and open the link it shows. When the first pageview arrives you see "Tracking confirmed". Details and troubleshooting are in check that tracking is live.
Let an AI agent do it#
If you build with Cursor, Claude Code, Codex or Lovable, click "Copy prompt" instead and paste it into your agent. See install with an AI coding agent.
Local development#
The tracker ignores localhost by default so your test visits do not pollute real data. Add data-allow-localhost="true" to the tag only if you want to test locally. Other options are covered in custom goals and data attributes.
Related articles
-
Check that tracking is live
How Boostra confirms your snippet, what each tracking status means and how to fix a missing or partial install.
Read article -
Install Boostra on Shopify
Connect your Shopify store with a custom app and Boostra installs tracking and imports orders for you.
Read article -
Install with an AI coding agent
Copy a ready-made install prompt for Cursor, Claude Code, Codex or Lovable and let your agent add Boostra.
Read article -
Subdomains and extra domains
Use one snippet for your domain and all its subdomains, and add extra domains only for a different registered domain.
Read article