React A/B testing
Drop one script into your index.html and test any screen of your React app. Route changes are picked up automatically, and you can read the visitor's variant in code if you need to.
Free plan · 1,000 visitors / month · no card
Set up in 3 steps
- 01Paste the snippet into the <head> of index.html.
- 02Mark the elements you want to test with a data attribute, like data-ab="signup-cta".
- 03Create a test with selector [data-ab=signup-cta] and a click or custom-event goal.
index.html
<script src="https://absplits.com/s.js" data-key="YOUR_SITE_KEY"></script>Your real site key is shown in the dashboard after you add your site.
What to test on React
All 56 examples →Say what happens next on the button
Make 'Continue with Google' the main sign-up option
Capture the email right in the hero
Test a 7-day trial against a 14-day one
Default the pricing toggle to annual
Real product screenshot vs stock photo in the hero
AI writes variants
Choose a headline or button and AI reads your real page to write 3–5 alternatives, each with its reasoning.
Honest stats
Chance to beat the original, 95% intervals, and a plain keep-running or stop verdict. No p-value guesswork.
Results in GA4
Every tested visitor is tagged in GA4, so any report can be split by variant.
Questions
How do I track a conversion from my React code?+
Call ABSplits.track("signup_completed") wherever the conversion happens, and set the test's goal to that custom event. For purchases, call ABSplits.revenue(amount).
Can I see results in Google Analytics 4?+
Yes. Every visitor in a test sends an absplits_exposure event to GA4 with the test and variant name, so you can break down any GA4 report by variant. AB Splits also shows its own Bayesian results.
A/B testing on other platforms