Redirecting Percentage of Traffic to Different Landing Page w/ Javascript or Python

winstonian

New member
Jul 14, 2012
2
0
0
When A/B testing, I typically use Optimizely for testing copy, call to action colors and positioning of elements. However, when testing a completely different landing page concept, I'd like to simply redirect the user that lands on the main landing page to the new landing page concept. Using Optimizely's redirect method isn't a good use of Optimizely (as it's a simple operation, and eats into Optimizely's monthly limit -- which I exceed every month).

So I'm trying to figure out how to do this on my own (fun n00b weekend hacker project) :)

My goal is: when a person lands on my main landing page ("Landing Page A"), I'd like to redirect 5% of the traffic to "Landing Page B", and 5% of the traffic to "Landing Page C".

I've done some research (meaning, I've Googled for a couple hours), and I haven't been able to find instructions or sample code on how to actually implement this.

Does anyone have any experience with this type of operation (traffic routing)?

Can you recommend a framework/article or provide some instruction on how I'd implement this in either Javascript or Python (the two languages I know best).

Thanks and look forward to hanging around here.

- winstonian
 


I would either use a random number generator to redirect given a 50% chance, or keep a counter in persistent storage. You could also toggle a flag, although that doesn't seem like the right way to me, but I guess it would work fine.

I wouldn't redirect traffic, I'd just code the handler for the URL to return a different view/template, that way the user experience is slightly better because the browser is getting one HTTP response instead of two.