How to set up a split test?

I want to create a way to test different layouts on a page to see which more conversions.

For instance. If I have 2 versions of a page, and I send 50% to page A and 50% to page B and see which one converts more sales.

So I think maybe use .htaccess to rewrite half to page A and the other half to page B.

But how can I do this with .htaccess, is there a way? Do I need to use PHP instead?

Also, if there is a better way to do this, or any warnings I should be aware of, let me know.

+3
source share
5 answers

, php, : , php , db ( , ..). , , , .

! , , , , A, B - 50%.

+1

PHP 5.2 , , phpScenario, www.phpscenario.org

- :

require_once 'scenario_setup.php'; // you write this
if (Scenario::IsControl('experimentname')) {
   // read and output version 1
} else {
   // read and output version 2
}

, (, ):

require_once 'scenario_setup.php'; // same
Scenario::Complete('experimentname');

(, ):

require_once 'scenario_setup.php'; // yup
Scenario::RenderXml('experimentname');
+1

, php . , rand :

$int = file_get_contents('var');
if ($int) {
  $int++;
} else{
  $int = 1;
}

if (($int % 2) == 0) {
  header('Location: url1);
} else {
  header('Location: url2);
}
file_put_contents ('var', $int);

apache : http://httpd.apache.org/docs/2.1/mod/mod_proxy_balancer.html

0

php . , var, . , , ( ), , .

0

Source: https://habr.com/ru/post/1749048/


All Articles