Free PHP Source Code: A/B Split Testing For Your Landing Pages


As with any type of marketing, you should always be testing new ideas + strategies in every facet of your work. The most important and most typically overlooked form of testing that is essential to getting a profitable conversion rate is in testing your squeeze or landing pages. Switch everything up! The images, the copy, heck even the entire layout + domain. You’ll never know what will make you money/convert until you actually find it and the best way to setup your site to systematically rotate through different landing page variations is by A/B testing (or in this case you could actually take it from A-Z as far as different destinations for your users). It’s just a small little php script that you put at the top of any page you’re sending traffic to. After each new referral comes through it just goes down the list of pages (you can also use domains if you wanted to try out different URIs). It’s that simple + there’s very little chance anyone will even realize they’re being redirected. Enjoy!

<?php
   if (!empty($_SERVER['HTTP_REFERER'])) {
      $currentPage = $_SERVER['PHP_SELF'];
      echo '<meta http-equiv="refresh" content="0; url='. $currentPage .'">';
      return;
   }

   // HERE IS WHERE YOU PUT IN YOUR PAGES/DOMAINS TO TEST. FEEL FREE TO COPY AND PASTE MORE!
   $domains   = array();
   $domains[] = 'quietaffiliate.com';
   $domains[] = 'twitter.com/quietaffiliate';
   $domains[] = 'wickedfire.com';


   $ct = count($domains)-1;
   $currentDomain = $domains[rand(0, $ct)];

   header("Location: http://www.$currentDomain/", TRUE, 301);
?>

One thought on “Free PHP Source Code: A/B Split Testing For Your Landing Pages

Comments are closed.