How to Set Up A/B Testing
Demo
This guide shows you how to set up A/B testing in WordPress with If-So — creating your versions, publishing the test, and tracking which one converts best. For an overview of what A/B testing can do and what you can test, see A/B Testing for WordPress →. This page focuses on the setup.
Overview: If-So’s A/B Testing at a Glance
If-So’s A/B testing lets you create 2 to 5 versions of any element — a headline, button, section, or image — and shows each version to an even share of your visitors. It tracks views and conversions for each one, and highlights the winning version once the results are reliable.
The A/B testing functionality is designed for straightforward use cases. It’s super simple to set up, and provides meaningful insights to help you identify what truly works.
The whole test is set up as a single trigger and placed with a shortcode, so there’s no external tool to connect or code to write (You can also run tests directly inside your page builder, with block-level testing in Gutenberg and element-level testing in Elementor).
Key Advantages of If-So’s A/B Testing Condition
- Easy setup – no external integrations or coding required
- Reliable data – clean session-based testing with built-in analytics
- Automatic consistency – users see the same version on every visit
- Up to five variations – test multiple ideas in a single experiment
How to Set Up an A/B Test
- On your WordPress dashboard, go to If-So → Add New Trigger. Screenshot
- In Version A’s condition panel, select A/B Testing from the first dropdown. Screenshot
- In the second dropdown that appears, choose 2 Variations – Version 1/2 (or 3, 4, or 5 variations, depending on how many you want to test). Screenshot
- Set Recurrence to Always (see note below) Screenshot
- Give the version a name in the version name field — for example, “Blue Button.” This name appears in your analytics, so make it easy to recognize. Screenshot
- Add the content for Version A. Screenshot
- Click + Add Another Version. Screenshot
- In Version B’s condition panel, select A/B Testing → 2 Variations – Version 2/2, then name it and add its content. Repeat for any additional versions, up to 5 (A/B/C/D/E). Visitors are split evenly between them — 50/50 for two versions, 33.3% each for three, and so on.
- If Ajax loading is enabled and the element is in an SEO-relevant position, set the Default Content — see Testing on Cached Sites and SEO below. Screenshot
- Publish your trigger and paste its shortcode wherever you want the experiment to appear. Screenshot
Your test is now live. If-So automatically records how many times each version is shown.
Note
For each version, set Recurrence to Always, so every visitor keeps seeing the same version across other pages and on return visits. Without it, a returning visitor could be assigned a different version, skewing your results.
How to Track Conversions
A conversion is the action you want visitors to take — reaching a thank-you page, completing a purchase, submitting a form.
- On your WordPress dashboard, go to If-So → Analytics. Screenshot
- Click + Create a new conversion.
- Fill in the conversion details (Screenshot):
- Conversion name — something recognizable, like “Checkout Complete.”
- Target URLs — the page where the conversion completes, such as your thank-you or confirmation page. Use + Add URL to count more than one page, and Strict QS matching if the URL’s query string must match exactly.
- Conversion count options — choose how often a single visitor can be counted: No limit, Once per session, or After a time limit. These prevent the same visitor from being counted twice if they refresh or revisit the page.
- Target triggers — which triggers this conversion applies to. Leave it on All Triggers to track the conversion across every test automatically, or narrow it to specific triggers.
- Exclude triggers — any triggers to leave out.
- Conversion name — something recognizable, like “Checkout Complete.”
- Target URLs — the page where the conversion completes, such as your thank-you or confirmation page. Use + Add URL to count more than one page, and Strict QS matching if the URL’s query string must match exactly.
- Conversion count options — choose how often a single visitor can be counted: No limit, Once per session, or After a time limit. These prevent the same visitor from being counted twice if they refresh or revisit the page.
- Target triggers — which triggers this conversion applies to. Leave it on All Triggers to track the conversion across every test automatically, or narrow it to specific triggers.
- Exclude triggers — any triggers to leave out.
- Conversion name — something recognizable, like “Checkout Complete.”
- Target URLs — the page where the conversion completes, such as your thank-you or confirmation page. Use + Add URL to count more than one page, and Strict QS matching if the URL’s query string must match exactly.
- Conversion count options — choose how often a single visitor can be counted: No limit, Once per session, or After a time limit. These prevent the same visitor from being counted twice if they refresh or revisit the page.
- Target triggers — which triggers this conversion applies to. Leave it on All Triggers to track the conversion across every test automatically, or narrow it to specific triggers.
- Exclude triggers — any triggers to leave out.
- Conversion name — something recognizable, like “Checkout Complete.”
- Target URLs — the page where the conversion completes, such as your thank-you or confirmation page. Use + Add URL to count more than one page, and Strict QS matching if the URL’s query string must match exactly.
- Conversion count options — choose how often a single visitor can be counted: No limit, Once per session, or After a time limit. These prevent the same visitor from being counted twice if they refresh or revisit the page.
- Target triggers — which triggers this conversion applies to. Leave it on All Triggers to track the conversion across every test automatically, or narrow it to specific triggers.
- Exclude triggers — any triggers to leave out.
- Click Create Conversion.
Once the conversion is set up, If-So records it automatically for your A/B test, crediting the last version the visitor saw before they converted.
Advanced conversion tracking: the conversion shortcode
For more control, a conversion shortcode is still available. It’s useful for legacy setups and for advanced cases — for example, placing the shortcode inside a conditional trigger so the conversion is counted only when a specific condition is met.
Reading Your Results
Open the analytics dashboard to see views, conversions, and conversion rate for each version, side by side. Once a test has gathered enough data, If-So checks whether the difference between versions is statistically significant and highlights the winning version — so you know when a result is reliable rather than an early fluctuation.
Note that admin views aren’t counted. If your versions don’t appear to alternate while you’re testing the page yourself, see Troubleshooting below.
Legacy: the conversion shortcode
The conversion shortcode from earlier versions still works. If you’re using it, those conversions are counted under the built-in General conversion in your analytics.
The shortcode is also useful for advanced setups — for example, placing it inside a conditional trigger so a conversion is counted only when a specific condition is met.
Testing on Cached Sites
If your site uses page caching — a caching plugin, a CDN, or host-level caching — enable Ajax loading so your test stays compatible with the cache. With Ajax loading, each version loads just after the cached page is served.
In some cahcing systems, you’ll also need to exclude the cookie ifso_recurrence_data from your cache, so each visitor stays on their assigned version (see Troubleshooting).
Troubleshooting
The versions don’t alternate.
If-So uses its built-in analytics to track which version a visitor has already seen, and admin views aren’t counted. Run your tests in a new incognito window — and close all incognito windows between tests, so your cookies are fully cleared each time.
The versions don’t alternate when I’m not logged in as an admin.
Same fix: test in a fresh incognito window, following the steps above.
Recurrence isn’t working.
If you use a caching plugin or other caching service, exclude the cookie ifso_recurrence_data from the cache.
Screenshots











FAQs
- Does If-So work with caching plugins and server-side caching?
Yes.
Whether you are using a caching plugin or server caching, you can navigate to the plugin settings and enable the “Page Caching Compatibility” option.
With the option enabled, dynamic triggers will be rendered in a separate request that will take place after the loading of the cached version.
- Can I spilt test 2 WordPress pages using If-So?Yes, technically, you can. Though one of the biggest advantages of If-So is that you don’t have to duplicate pages. Instead, you can split-test only a specific piece of content on the same page. Nevertheless, if you want to split-test a whole page, you can do so using a simple JavaScript redirect code that can be pasted inside an If-So trigger. We already have the redirect code ready for you. You can learn more and find it here.