Jump to content

Simple Split-Testing script


Jon12345

Recommended Posts

I want to create a very simple split-testing script that will alternate between displaying the content from page1.php and page2.php. This content will be shown on index.php.

 

If the visitor comes back to that page, it must show the same page they saw before.

 

It must track the number of times each page is displayed and the click through rate of each page. This way, I can calculate which page is better for sales.

 

Please note that page1.php and page2.php will have php code on them as well as html.

 

Thanks,

 

Jon

Link to comment
https://forums.phpfreaks.com/topic/39556-simple-split-testing-script/
Share on other sites

Simplest way I can think of is to have a text file holding

 

last page displayed

page1 count

page2 count

 

Each time index.php is called it checks the file to see last page displayed and includes the other one, then updates the text file.

 

For the visitor, store which page they saw in a session variable so they can return to the same one.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.