Search engine optimization guidelines

Use the following guidelines and best practices to create effective experiments and ensure that testing variations in page content or page URLs has no negative impact on your search performance.

Historically, web crawlers were not able to crawl and index content created dynamically with the help of JavaScript and were only able to see what was in the static HTML source code. Because the changes you make within a test are typically applied via JavaScript in the client's browser, legacy web crawlers did not see the same modified content from your pages.

Google in particular has evolved and web crawlers are now generally able to render and understand web pages the way an up-to-date client browser does. Google permits and encourages A/B testing and has stated that performing an A/B or multivariate test poses no inherent risk to your website’s search rank. However, it is possible to risk your search ranking by abusing a testing tool. Follow these guidelines to ensure that this does not happen:

  • Avoid cloaking: Do not display content to a web crawler that is substantially and materially different than that displayed in the client's browser. You should not use an A/B testing platform to change the spirit of the page. If Google or another search engine interprets your changes as cloaking, your website may be subject to a penalty. Instead, use links or redirects for significantly different content.
  • Use canonical links for whole-page variants: If A/B test variants are distributed across different URLs, place a rel="canonical" link on alternate pages that points to your original page. This helps point web crawlers indexing your website to your original variant. Experiments involving redirects should be OK as long as they do not redirect to unexpected or unrelated content.
  • Use 302s for server-side redirects: If you are running a test that redirects visitors from the original URL to a variant's URL, use an HTTP 302 status code to indicate a temporary redirect—not a 301 (permanent) redirect. The 302 status code tells search engines that this redirect will only be in place as long as you are running the experiment and that they should keep the original URL in their index and not replace it with the target of the redirect. JavaScript-based redirects are also OK.
  • End experiments on time: Once you identify a winning variant, end the experiment and deploy the leader through your existing web development process.

Following these best practices should result in your tests having little or no impact on your site's ranking in search results. Depending on the types of content you are testing, it may not even matter much if web crawlers index some of your variants while you are testing. Small changes (such as the size, color, or placement of a button) can have a surprising impact on users' interactions with your web page but often have little or no impact on its search result snippet or page ranking.

Learn more

Best practices for website testing with Google search

Optimize and Google search

Website testing and Google Search

Introduction To Crawling JavaScript

AB testing and search engine optimization

SEO, search performance, best practices, guidelines, cloaking, 301, 302, canonical