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 · 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 integrations