Just want to chat? Talk some smack. If it doesn't fit into one of the areas below then you'll be posting here (Note: Please try and find the best section before posting here)

Easy Way of Testing Different Affiliate Products

Posts: 27
Joined: 24 Jul 10

Easy Way of Testing Different Affiliate Products

Not sure if this is of use to anyone else, but it solved a problem I was having when I was looking at split testing different affiliate products, so I thought I'd share it.

I've got a site in a health niche that's getting ok traffic and has converted some sales for the affiliate product I'm promoting. But there are lots of other products in the niche, including some new ones, and I was wondering if they would convert better. I wanted a quick and easy way to send my traffic to a number of these offers, to see which one had a better conversion, and I found this really useful piece of javascript code.

When a visitor hits the page with the script on, it chooses a URL at random, from a list you've included in the code, and then redirects the visitor off to that page. What it means is that I can send all my traffic to the 4 different affiliate products I want to test, quickly, simply, and automatically. It does choose the URL at random, so some offers will probably get more traffic than others, but over a couple of weeks I should be able to see the conversion rates for each of them, to decide which one of them should be getting all my traffic.

Here's a quick overview of how I set it up:

1 - Create a new .html file in my C-Panel File Manager that all my banners, images, and text links will point to
2 - Add the 'random URL' javascript code to this page
3 - Add the hoplinks for each of the products I want to test to the 'random URL' code

That's it - now all my traffic will be dished out to the different offers, allowing me to test and see which one converts best.

I'm not a coding expert, but can add basic stuff like this through my C-Panel file manager. Thought this might be useful for anyone with a general niche-related site (rather than specific product review type sites), and if you want the code, I've attached it below.

<script language=javascript>

//Variable for random number.
var i;
//Array for links.
var arLinks = new Array();

//Change links to what you wish... and however many you want*...
// *Just be sure to increment the array element if you add more.
arLinks[0] = "URL FOR HOPLINK 1";
arLinks[1] = "URL FOR HOPLINK 2";
arLinks[2] = "URL FOR HOPLINK 3";
arLinks[3] = "URL FOR HOPLINK 4";

//Create random number, based on number of elements in array.
i = Math.floor( Math.random() * arLinks.length );

window.location = arLinks[i];


I think the code originated from http://castleamber.com/john/cgians.html, just to give due credit.

P.S. - I also included an extra step for my website, with additional pages that mask my hoplinks, which is also pretty easy to do.
  • 0

This topic was started on May 21, 2011 and has been closed due to inactivity. If you want to discuss this topic further, please create a new forum topic.