473,395 Members | 1,581 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

setting up a A/B split test with PHP

hi all,

I would like to test different page layout / creative elements of a
website using a A/B/C split run test.
How could I set it up using php?
Basically, I would like to include a different html code for different
visitors and see which gets the best click-through, conversions etc.
The stats tracking part it's not a problem , it's just how could I show
the first user the A version, then to the second the B version and then
the C one to the third and so on with the A version to the fourth etc.

How could it be the php script ? should I take note of the number of
visitors in a database and then doing some maths? but how ?

Please point me in the right direction

Thanks in advance
Johnny

Nov 29 '05 #1
5 4973
Look into sessions. In the session variable, you can store the chosen
version, so that you can present the same version with the next hit.

Nov 29 '05 #2

"Sjoerd" <sj******@gmail.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Look into sessions. In the session variable, you can store the chosen
version, so that you can present the same version with the next hit.


Don't you mean the present next version with the next hit?

What about using the Modulus operator?
Nov 30 '05 #3
When a new user enters your site, you can give him a random version.
However, you do not want that the version changes while the user is
visiting your site. So if a user clicks a link, that next page has to
be loaded with the same version. This can be accomplished with sessions
or cookies.

Nov 30 '05 #4

Sjoerd wrote:
When a new user enters your site, you can give him a random version.
However, you do not want that the version changes while the user is
visiting your site. So if a user clicks a link, that next page has to
be loaded with the same version. This can be accomplished with sessions
or cookies.


thanks guys .

however, I am afraid sessions is not what I am looking for.
I mean, keeping the same version during the visit of the same user is
not my primary goal, the split run testing is needed to know which
different creative/ layout option ( ie some copy in the text , the
position of a form etc. ) is more efficient.

So the test is usually performed on single pages, often homepages or,
better, landing pages.

What is really important is that if for instance I have to test 3
different version of something, each option must have the same number
of impressions in order to have reliable stats to anlayze ( so 33,3%
of visitors must have seen one of the 3 different pages).

I realized that I should have a look at banner rotation management
scripts without using any random function because the core of my script
must be an equal number of views for each version.

I had no time to search properlly the web for those scripts yet but the
only one I have saw used a database table to know each time which
version of the banner has to be included in the page following an array
order

Anyway , any suggestion is always welcome

Johnny

Dec 2 '05 #5
fill in the blanks...
$i = "select count from abcounter"...

if ($i%3 == 0){$page = "1.php";}
if ($i%3 == 1){$page = "2.php";}
if ($i%3 == 2){$page = "3.php";}

"update abcounter set count = count+1"...

header("Location: $page");

Dec 8 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martijn Ras | last post by:
Heya folks, I ran into the following problem: When i run this on Windows everything is as expected: C:\>python Python 2.2.3 (#42, May 30 2003, 18:12:08) on win32 Type "help", "copyright",...
12
by: Martin Dieringer | last post by:
I am trying to split a file by a fixed string. The file is too large to just read it into a string and split this. I could probably use a lexer but there maybe anything more simple? thanks m.
2
by: bagsmode | last post by:
Hi, I'm trying to set a session cookie and then redirect, however I get the error: Status: 302 Moved Location: /index.cgi I thought I recall getting an error like this when I first tried...
4
by: Brian Glen Palicia | last post by:
My goal is to accept input from the user into a text box and then parse the data using split(). The first step is this tiny program to test the split() function. It runs in IE, but in Mozilla it...
5
by: Vamsi | last post by:
Hi, I am trying a basic opearation of splitting a multiline value to an array of single lines(Actually making Address into AddressLine1, AddressLine2). I used Environment.NewLine in split, I...
3
by: David Pratt | last post by:
Hi. I am splitting a string on a non whitespace character. One or more whitespace characters can be returned as items in the list. I do not want the items in the list that are only whitespace (can...
1
Atli
by: Atli | last post by:
The following small HowTo is a compilation of an original problem in getting some cookie-values through different methods of string-handling. The original Problem was posted as follows: As...
22
by: SmokeWilliams | last post by:
Hi, I am working on a Spell checker for my richtext editor. I cannot use any open source, and must develop everything myself. I need a RegExp pattern to split text into a word array. I have...
14
by: Stevo | last post by:
If you split a string into an array using the split method, it's not working the way I'd expect it to. That doesn't mean it's wrong of course, but would anyone else agree it's working somewhat...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.