Frameworks and SPAs
Pertento for React
A single-page app needs the tag once, in the HTML shell. Variants survive routing rather than being reapplied per view.
One script tag · 0.9 KB loader · no cookiesAll integrations
A React single-page app loads one document and then changes it, which is exactly the case a per-page testing tool handles badly. Pertento is installed once in the HTML shell and stays live for the session: as the router swaps views, the variant assigned to the visitor continues to apply, and targeting rules are re-evaluated against the new path without the visitor being reassigned. That is what makes a test on a route deep inside an app behave the same as a test on a landing page.
How it connects
- Add the tag to the head of the shell document that serves the app.
- Target by path, and expect rules to be evaluated again after each route change.
- Send exposure events onward if the app’s own analytics is where conversions are counted.
More in Frameworks and SPAs
All integrationsNext.jsRender the tag in the root layout so it loads before hydration, and variants persist across client-side route changes.How it connectsNuxtOne entry in the app head configuration covers every route, and it lands in the server-rendered HTML rather than after hydration.How it connectsVueInstall once in the app’s HTML entry point; targeting is re-evaluated on each route change without reassigning the visitor.How it connects