Forum Moderators: open

Message Too Old, No Replies

One link to 2 destinations... how?

Any useful javascripts or other ideas on how to do this?

         

zander213

1:15 am on Aug 31, 2004 (gmt 0)

10+ Year Member



Hi,

I am doing some testing on a site, and I would like to run some traffic through 2 versions of the same page, with different layout and formatting to test conversion.

How can I use one link that will give me a 50/50% split in traffic (or some other percentage)?

Do you get what I am trying to do here?

Any help would be greatly appreciated!

mack

1:29 am on Aug 31, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Hi there. you can acheive this pretty effectivy using javascript. Here is some code from my collection.

In your <head></head> area insert the following...

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function go_to(url) {
window.location=url;
}
function rand_link() {
var a;
a = 1+Math.round(Math.random()*3); // a = random number between 1-3
if (a==1) go_to("http://www.example.com");
if (a==2) go_to("http://www.example.com");
if (a==3) go_to("http://www.example.com");
}
// End -->
</SCRIPT>

Then place the following code where you would like the random link to be placed...

<FORM NAME="myForm">
<INPUT TYPE="button" NAME="myButton" VALUE="link"
onClick="rand_link()">
</FORM>

That code actualy uses a button to work as the link.

Mack.

zander213

1:40 am on Aug 31, 2004 (gmt 0)

10+ Year Member



Thanks! Just what I was looking for!

bcc1234

1:51 am on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Whatever solution you use - make sure it accounts for returning visitors. It can be server-side or client-side, but make sure it sets cookies and redirects returning visitors to the same destination as it did on the first click. Otherwise, your testing results will be off.

zander213

2:20 am on Aug 31, 2004 (gmt 0)

10+ Year Member



Hmmmm...

How do I set a cookie to ensure a returning customer returns to their respective page?

Also, how do I make a text link instead of that button?

Thanks a bunch!

bcc1234

8:15 am on Aug 31, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



All my stuff is in java, so it won't be of much help.