Best method to redirect randomly at 10:1

G

Grant Merwitz

Hi

We are conducting a test with our website.
We are going to redirect every 1 in 10 visitors to a new default homepage to
determine the effectiveness of this page.

I'm looking for ideas on how to do this.

1 thought i've already had:

Everytime a visitor comes to the site, i can hold an application
variable with a number in it, and increment it by 1.
When that gets to 10, i can send that user to the test default page, and
reset the app variable back to one.

Any other ideas, or better methods.
Or even problems with this potential method.

Thanks for any help on this
 
S

Scott Allen

Hi Grant:

You can roll the dice with the Random class. The Next method will give
you a random number, inside of a range if you wish. Based on this
number you could decide if you want to redirect. This approach would
be more random than redirecting every 10th request.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top