An A/B test can stay accessible to search engines. Use the same assignment rules for users and crawlers, keep alternate URLs tied to the original page, and remove the test setup when it ends.
Do not serve Googlebot a special control page while comparable visitors receive materially different content. Google's website-testing guidance applies its usual rules against cloaking during experiments.
Decide whether the test needs a second URL
A headline or button test can usually use the existing URL. Separate pages make sense when the experiment changes the document or navigation flow.
| Test | URL setup |
|---|---|
| A component changes on the same page | Keep the page's self-referencing canonical and primary purpose consistent |
| Some visitors move from the original URL to a test page | Use a temporary 302 redirect |
| Visitors can open the test URL directly | Point its canonical to the original URL |
For a test page that should be consolidated with the original, use a canonical rather than noindex.
Check visitors without cookies
Googlebot generally does not retain cookies. A visitor without cookies should still receive a complete page under the normal assignment rules. Avoid user-agent or crawler-IP checks that exist only to force Google into one variant.
Record the experiment and variant in server logs so you can reproduce what happened. An internal response header can also help during QA:
X-Experiment: checkout-copy-2026-07
X-Variant: b
Keep personal or sensitive assignment data out of public headers. Check the cache key too: if assignment depends on a cookie but the shared cache ignores it, one visitor's variant may be served to everyone.
Test every accessible variant
Request the original page and each test URL without cookies, then repeat with each valid assignment. Check that:
- the status, canonical, and robots directives match the intended setup;
- primary content remains available to ordinary visitors and crawlers;
- navigation renders as links with an
href; - the cache respects the assignment;
- analytics records each exposure once, rather than again on every render.
For example, a temporary redirect can send an assigned visitor to a variant:
HTTP/1.1 302 Found
Location: https://example.com/landing-page?variant=b
The variant points back to the original:
<!-- on the directly accessible variant -->
<link rel="canonical" href="https://example.com/landing-page">
Remove the test setup when it ends
Apply the winning content to the final page. Remove assignment code, temporary redirects, test-only parameters, and cache rules. Redirect retired test URLs that no longer need to exist to the final page, and update links and sitemap entries that still advertise them.
Run the response checks again after cleanup. A finished experiment should leave one clear public destination, without old assignment code changing what visitors receive.
