Rudra Kasturi Inc.

Article · SEO

A/B testing without hurting search: Google's four rules and a test runbook for SEO teams

SUMMARY

Google's A/B testing page says do not cloak test pages, use rel=canonical on alternate URLs, use 302 rather than 301 redirects, and run the experiment only as long as necessary, then remove the test elements. Googlebot generally does not support cookies. The runbook is ours.

Growth teams test pages all the time, and SEO teams are often asked afterwards whether a test hurt search. Google’s testing page gives four rules. This post turns them into a runbook you can attach to every experiment ticket.

Best for: SEO leads working with product, growth and conversion teams. Learners are welcome: each step names who does it and how to check it.

New to SEO or AEO? An A/B test shows different versions of a page to different visitors to see which works better. The risk for search is that Google may see versions you did not intend, so the setup matters.

SEO and AEO angle: Google’s generative AI guide says its AI features are rooted in core Search ranking and quality systems, so the SEO hygiene in this post applies there too.

A/B testing and search: do not cloak, canonical the variants, use 302 redirects, and end the test promptly

What Google says

  • Do not cloak test pages. Showing one set of URLs to Googlebot and a different set to humans is cloaking and is against the spam policies, whether or not you are running a test. That includes doing it with server logic or robots.txt.
  • If cookies control the test, remember that Googlebot generally does not support cookies, so it sees only the version available to browsers that do not accept cookies.
  • If a test uses multiple URLs, use rel="canonical" on the alternate URLs to point at the original. Google recommends this over noindex because it better matches the intent. Using noindex in that situation can sometimes have unexpected bad effects.
  • If you redirect users to a variation, use a 302 (temporary) redirect, not a 301. JavaScript-based redirects are also fine.
  • Run the experiment only as long as necessary. Afterwards, update the site and remove all test elements, such as alternate URLs and scripts, as soon as possible. Google says an unnecessarily long experiment, especially one that serves one variant to a large share of users, may be read as an attempt to deceive.
  • Small changes, like a button colour or call-to-action text, often have little or no impact on the snippet or ranking.

What to do: step by step

StepOwnerTimeHow to checkDone when
1. Classify the testSEO15 minSmall element change, or new URLs for variantsType written on the ticket
2. Rule out cloakingDeveloper30 minBots and users receive the same variant logicNo user-agent based switching
3. Canonical the variantsDeveloper20 minEach alternate URL points to the originalCanonicals verified in the live HTML
4. Choose the redirectDeveloper15 minStatus code of the redirect is 302No 301 on a test
5. Set an end dateProduct10 minDate and the tool’s stopping rule on the ticketTest has an owner and end date
6. Clean upDeveloper30 minVariant URLs, scripts and markup removedNothing from the test remains

Example (made up)

A team tests two checkout buttons on one URL with JavaScript and a cookie. The SEO lead confirms there is no user-agent logic and sets a two-week end date. After the result, the winning button ships and the script is deleted the same week. A second test with separate variant URLs gets canonicals and a 302.

Common mistakes

  • Using a 301 for a temporary test.
  • Adding noindex to variants instead of rel=canonical.
  • Letting a finished test script run for months.
  • Serving a different version to crawlers.

Related: which redirect to use, spam policies self-audit and JavaScript SEO check. Results are not guaranteed.

Sources