Documentation · Prynt Reveal · Install

Astro

A `<script>` in the shared layout runs once per page load. With View Transitions the URL changes through the History API, which Reveal follows.

Add the script to the layout

npm install @pryntid/js
---
// src/layouts/Base.astro (or any layout used by every page)
---
<html>
  <head>…</head>
  <body>
    <slot />
    <script>
      import { reveal } from '@pryntid/js/reveal';
      reveal({ publicKey: 'pk_live_YOUR_PUBLIC_KEY', website: 'example.com' });
    </script>
  </body>
</html>

<!-- View Transitions (<ClientRouter />): Astro keeps the page alive and changes the URL through
     history.pushState, which Reveal already follows. Nothing else to do. -->

Astro bundles the <script> and runs it in the browser only. Prefer the CDN snippet instead? Paste it inside <head> of the layout with is:inline so Astro leaves it untouched.

Notes

  • With <ClientRouter /> (View Transitions) module scripts run once; later navigations are pushState calls and become pageviews. Without it every page is a full load, which is also fine.
  • Islands (React/Vue/Svelte components) do not need anything: identification is page-level.

Run the Test Script

  1. In the console go to Websites → your site → **Test Script**. It fetches your page from our side and runs the seven checks: snippet present, public key, website match, CSP script-src, CSP connect-src, consent manager, script position and www redirect.
  2. Open your site with ?prynt_debug=1 to see the live panel from the browser's point of view (consent, CMP, storage, cspBlocked, last send).
  3. Visit two or three pages. The pulse in the console shows the last event within seconds; the first companies appear as soon as a business network visits.

A cspBlocked: true or a failed CSP check means your Content-Security-Policy needs the two lines from CSP and storage. Running a consent manager? Consent explains what is detected and what is sent before the visitor decides.

Next: WordPress (WPCode)

Last updated 2026-11-03 · Limits · Visitor opt-out