Skip to main content
Add the tag to the <head> of your base layout with is:inline. It tells Astro to leave the tag exactly as written, so it stays a plain script that runs before the page shows.
src/layouts/Layout.astro
  • Islands: with data-await-hydration="true", pagent waits for islands with client:load and client:idle to hydrate. Islands with client:visible or client:media hydrate later, so test variants inside them with a preview link.
  • No islands? A fully static Astro site doesn’t hydrate, so you can leave out data-await-hydration.
  • View transitions: navigation with Astro’s client router is tracked automatically.
See Frameworks for the shared rules and the Content Security Policy.

Check it worked

  1. Deploy, then open your site in a private browser window.
  2. Back in pagent, click Check connection in the install step.
  3. Open a test’s preview link and check that the variant shows and stays after the page has finished loading.