🛠️ [Troubleshooting] Avoiding SEO mistakes in a redirection test

When you set up a redirect test, i.e. when you use another URL as a variation, you must take search engine optimization into account. Google can find and index your alternate pages even if you’ve placed a <meta name="robots" content="noindex, nofollow"> tag in the <head> section of the pages. The risk is therefore that these will replace the original pages in the search engine results pages (SERPs).


What should you do?

Google provides the solution. Use the attribute rel="canonical" rather than a noindex tag on your alternative pages. We’ll summarize how to do it here. 

In its post, Google sets out some guidelines for a redirect test. Here are five of them:

  1. No cloaking

    Showing one set of content to the user and a different set to search engines, for instance using user-agent detection. An example of this would be always serving the original version to search engines. You have nothing to worry about on this score: AB Tasty does not make decisions based on the user-agent Googlebot. 

  2. Use 302 or JavaScript redirects

    – rather than 301 redirects. 302 or JavaScript redirects tell search engines that this redirect is temporary – it will only be in place for as long as you’re running the test – and that they should keep the original URL in their index rather than replace it with the new one. In a redirect test, AB Tasty uses a JavaScript redirect, so you have nothing to worry about here, either.

  3. Use rel="canonical" 

    Add the attribute rel="canonical" to all your alternate URLs and use the original URL as the value of this attribute. Google explicitly recommends using this method rather than placing a <meta name="robots" content="noindex"> tag on alternate pages. This clearly indicates your intention to Google and the fact that the alternates are relatively similar versions of the original and should be treated as such. Google also says that using the noindex tag rather than rel=canonical can lead it to choose one of the alternate versions as the canonical version, which might mean it appears in the search results, and sometimes that the original version gets dropped.

  4. Don't block Google’s crawl

    Do not block Google’s crawl on your alternative page. Instead, use for instance the robots.txt file.

  5. Only run the experiment as long as necessary

    Google knows that the time required for a test will vary depending on how much traffic the tested page gets, but says you should avoid running tests for an unnecessarily long time as it may interpret this as an attempt to deceive the search engine, especially if you’re serving one content variant to a large percentage of your users.

Was this article helpful?