Dukeo » Internet Marketing » Rotate Affiliate Offers: PHP Snippet

Rotate Affiliate Offers: PHP Snippet

Steven Internet Marketing

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.

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

Subscribe to my exclusive newsletter, and discover the internet marketing secrets the pros don't want you to know»

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.

If you enjoyed this article,
Get email updates

Join for Free »