Rotate Affiliate Offers PHP Snippet

Advertisement
Dukeo » Marketing » Internet Marketing » rotate affiliate offers
Internet Marketing0 min read
Advertisement

We are always talking about split-testing offers in Affiliate Marketing. People who know about website coding probably won’t need the following code, however it might sound like black magic to people who have absolutely no clue about website coding.

The following code allows you to easily rotate 2 affiliate offers. You just need to create a file named go.php and paste the following code in it.

<?php
  $random = rand(1, 2);
  if ($random=='1') {
    header('Location: http://www.website-1.com/');
  } else {
    header('Location: http://www.website-2.com/');
  }
?>

Join 12,100 bloggers taking my FREE Course: How to Start a Money-Making Blog in 7 Days»

To make sure this code will work, you need to replace http://www.website-1.com/ with a url to your first offer, and http://www.website-2.com/ with a url to your second offer.

Then you simply need to upload this file to your FTP server.

Now, when a visitors goes to visit your file go.php, they will be randomly redirected to one offer or the other.

Advertisement

Start Your Blog Right Now!

Join 12,100 bloggers taking my FREE course:How to Start a Money-Making Blog in 7 DaysSimply input your best email below to get started.

Advertisement

Start Your Blog
Right Now!

Join 12,100 bloggers taking my FREE course:
How to Start a Money-Making Blog in 7 Days

No thanks, I have enough money