How can I have 20% of all random visits go to my 2nd landing page?

3 replies
  • SEO
  • |
I would like to test out another landing page, but I want to be all types of traffic, not just PPC traffic or anything. How could I happen to do this?
#20% #2nd #landing #page #random #visits
  • Profile picture of the author crispin
    you could do it with php.

    $rand = rand(1,5);
    if($rand == 5)
    {
    redirect to page2;
    }
    else
    {
    redirect to page1;
    }

    this type of thing. (the "redirect to page2" is not exact code - you'd have to use a 'header' command and I forget the syntax)

    Or you can just show a different page depending on $rand;
    {{ DiscussionBoard.errors[671231].message }}
    • Profile picture of the author mr_banks
      here is the PHP Header code

      header("location: http://yourUrl.com");

      if you use this code though make sure to use an overflow buffer or the redirect will not work.

      put this at the top of your script:

      <?php ob_start(); ?>

      then this goes at the bottom:

      <?php ob_flush(); ?>
      {{ DiscussionBoard.errors[673280].message }}

Trending Topics