What are the best practices for server-side A/B testing?
-
When performing a full-site server-side A/B test, what best practices should you follow to ensure that you're:
- not cloaking or at least not being shady
- only showing Google (and other search engines) the version you want them to see (i.e. not the test pages)
Thanks in advance!
-
The definition of cloaking according to Google is "the practice of presenting different content or URLs to human users and search engines." For that reason, there is some risk in showing Google a different page than what is being shown to your users in the test. Displaying different content based on user-agent is a red-flag to Google.
That being said, cloaking penalties are "manual actions", meaning they are manually applied by human reviewers on Google's team, so unless you are purposely trying to be deceptive, the risk of being penalized is low. Additionally, you can request reviews of manual actions via Google Search Console to appeal any penalties.
Another approach could be to use server-side redirects for the test, using 302 redirects and redirecting users bucketed into the test to a separate URL. The 302 redirect indicates to Google that this is a temporary change, and that they should retain the original page in their index. You can further reinforce this by adding a canonical tag to the test page and pointing it to the original version of the page.
Finally, for high priority SEO pages you may also consider using a client-side A/B test. Client-side A/B testing uses Javascript to dynamically change the content on the page, and is typically not indexed by Google.