The Technical Bit: Using Redirects
As mentioned, the big problem with the method described in the previous chapter, is that it doesn’t allow you to control for every single confounding variable. While you might run lots of tests with very similar pages, they are still different pages, and they might still succeed or fail based on other factors. While you can use larger groups to minimize this effect, it’s still ultimately going to mean basing your decisions on ‘estimated guesses’.
And there are limits to just how many pages you can use in a split AB test. If you’re going to be changing the results across hundreds of pages on your site, then this will involve a LOT of work. What’s more, is that you will be potentially hurting your site in a big way if the change proves to be a mistake. The whole point of AB testing is to conduct the experiment in a controlled manner. So, what can you do?
One answer is to use a redirect, which has different and unique pros and cons.
A redirect simply means that you are going to send visitors to a different version of the website. This will use a number of different methods (more in a moment), but one of the simplest is the HTML redirect. The browser will read this code, and will then follow it to the new page:
<META HTTP-EQUIV="REFRESH" CONTENT="0; URL='HTTP://NEW-WEBSITE.COM'" />
If you use this method, then as soon as a visitor lands on a web page, there will be a short pause, and then they will be sent to the new web page.
Of course, this version of a split test also has its limitations. After all, there is no way for Google to alter its ranking depending on which page performs best. That’s because the two versions of the page are one and the same as far as Google is concerned! Meaning that they will only rank once, depending on which version Google took into account.
So how can this be used to monitor your SEO performance?
This is useful for measuring a host of factors that will impact on your SEO. That means things like bounce rates, things like CTR (click through rate), and more.
While this might not directly affect your ranking, seeing which page design or content is best for audience retention will have a big effect on your ranking, and so this can be just as useful.
Which type should you use? The answer is of course both – if you have the time. The more data you collect, the smarter decisions your business will make, and the more likely you are to see performance boosts.
Better Redirects
The redirect used above will work as described to send a user directly to a different website. This way, they can experience a temporary alternative to your main page, without hurting the appearance of that page.
Of course, what we really want to do though, is to ensure that the page only loads for half of the visitors. That’s where we need to get a little more savvy. What’s more, is that we want Google to get sent to the new page as well. As it is, 100% of our visitors are being sent to the new page and Google’s spiders will recognize that the page is a redirect and not a regular page. So why would it rank it as normal?
Instead, you’ll be better off using a PHP redirect. PHP stands for PHP: Hypertext Preprocessor. And yes, that means that it has its own name in the acronym, which is extremely confusing!
PHP is a form of scripting language that runs on the server, rather than in the browser. Your website is stored on a server somewhere, which is essentially a large computer, and the HTML code is then sent to and interpreted by a browser each time someone types in the correct URL. Because PHP runs on the server, that means that it runs before the browser ever sees it. In turn, that means that the page will appear in the browser fully formed.
You can redirect in PHP by creating a PHP file with the name of your page and then inserting the following text:
< ?PHP HEADER("LOCATION: HTTP://WWW.REDIRECT.TO.URL.COM/"); ?>
This will now redirect visitors to the new location, and it will do so in a way that is impossible for anyone to detect. Even if they were to view source, the source they’d see would be the HTML for the new page!
The next thing we need to do is to ensure that only half of the visitors are sent to the new page, and we can do this by randomly redirecting those visitors.
<?PHP
SRAND((DOUBLE)MICROTIME()*1000000);
IF (RAND(1,2)==1)
{
HEADER("LOCATION: HTTP://WWW.REDIRECT.TO.URL.COM/");
};
?>
What this does is to choose a random number between 1 and 2, and if the number is one then it sends the visitor to the new page. If not, they stay where they are. This works by using a timer to choose the number, hence the need for the microtime part.
You don’t really need to know how this works though, only that it does work.
Using Include
While this method of redirecting visitors can be effective, it still isn’t quite perfect. You still have two different web pages, which could potentially confuse results. The URL in the address bar will be different for example, which could result in action from Google (more on this in a bit) and whi...