Jump to content

Recommended Posts

Hi,

 

I'm trying to set up a simple A/B test using PHP. I tried just using a random script, where it goes to either page1 or page 2 randomly through the redirector page. However i notice it doesn't give a 50/50 split, ie attempt 1 it went to google, attempt 2 it went to google, attempt 3 it went to yahoo. i need for instance a counter where all the even numbers go to google and all the odd numbers go to yahoo, that would be the most accurate way i could think of without having to use a database (which I want to stay away from). therefore, is there a way i could maybe have a counter stored in a text file where it increments for every visit and all the odd numbered hits go to one page and all the even numbered hits go to another. would anyone know how to do this?

Link to comment
https://forums.phpfreaks.com/topic/51984-simple-ab-testing/
Share on other sites

my problem is I want exactly 50% of my traffic to be redirected to 1 page and exactly 50% to the other. With the random redirector it isn't totally accurate, everytime i refresh sometimes it goes to the same page 2 or 3 times in a row before going to the alternate page. i was thinking if i could have a counter of some sorts, it could get the hit number for each customer and all the odd numbered hits go to 1 page and all the even numbered hits go to the other page. Do you follow?

Link to comment
https://forums.phpfreaks.com/topic/51984-simple-ab-testing/#findComment-256226
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.