Skip to main content
Gatsby’s <Script> component has no strategy that runs before the page shows, so add pagent to the document head in gatsby-ssr.js:
gatsby-ssr.js
  • Keep data-await-hydration="true". pagent recognizes Gatsby’s hydration and applies the variant after it.
  • Navigation with Gatsby’s <Link> 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.