<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.
Check it worked
- Deploy, then open your site in a private browser window.
- Back in pagent, click Check connection in the install step.
- Open a test’s preview link and check that the variant shows and stays after the page has finished loading.