我想创建一种方法来测试页面上的不同布局,以查看哪些布局获得更多转化。
例如。如果我有一个页面的 2 个版本,我将 50% 发送到页面 A,将 50% 发送到页面 B,然后看看哪一个版本转化的销售额更多。
所以我想也许使用 .htaccess 将一半重写到页面 A,另一半重写到页面 B。
但是我怎样才能用 .htaccess 做到这一点,有办法吗?我需要使用 PHP 来执行此操作吗?
另外,如果有更好的方法来做到这一点,或者我应该注意的任何警告,请告诉我。
I want to create a way to test different layouts on a page to see which get more conversions.
For example. 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 am thinking maybe use .htaccess to rewrite half to page A and the other half to page B.
But how can I do that with .htaccess is there a way? do I need to use PHP instead to do this?
Also if there is a better way to do this, or any cautions I should be aware of, please let me know.
发布评论
评论(5)
有很多方法可以在您自己的代码中处理它。但是,如果您已经在使用 Google Analytics 并且不喜欢使用 javascript 进行测试,请省去很多麻烦,看看 http://www.google.com/websiteoptimizer/index.html
更新(重新限制):Google 网站优化器不再存在,已替换为“Google Analytics 内容实验” https://developers.google.com/analytics/devguides/platform/experiments-概述
Lots of ways to deal with it on your own code. If however you're already using Google Analytics and don't care to use javascript for the test, spare yourself a lot of trouble and look at http://www.google.com/websiteoptimizer/index.html
Update (Reconfine): Google website optimizer no longer exists, this has been replaced with "Google Analytics content experiments" https://developers.google.com/analytics/devguides/platform/experiments-overview
我会使用 php 来做到这一点,如下所示:
用户到达默认的 php 文件后,我会将他的浏览器数据存储在数据库表中,以及活动布局标识符(文件名、行 ID 等)。
每当服务器收到该用户的请求时,它就会显示映射到该用户的页面。
但!如果你有两个独立的页面,我只会存储有多少人访问了网站一和网站二,并将他们重定向到页面 A,并按 50% 的比例重定向到页面 B。
I would do that using php, following way:
After the user got to the default php file, i would store his browser data in a db table, and the active layout identifier (filename, row id, etc...).
Everytime the server gets a request from this user, it shows the page, mapped to him.
But! If you have two independent pages, i would only store how many people visited site one, and site two, and redirect them to page A, and to page B by a 50% division.
如果您有受支持的数据库并且使用 PHP 5.2 或更高版本,则可以使用名为 phpScenario 的免费拆分测试库,该库位于 www.phpscenario.org
然后你或多或少会写一些类似这样的内容:
然后当你到达你的转换点(比如注册)时:
并查看统计信息(可能在您的管理页面):
If you've got a supported database and are using PHP 5.2 or later, you can use a free split testing library called phpScenario, found at www.phpscenario.org
Then you write more or less something like this:
Then when you get to your conversion point (say, sign up):
And to view the stats (probably on your admin page):
我认为php会非常有用。例如,您可以使用 rand 或将变量推送到文件中:
使用 apache,您必须设置负载平衡器: http://httpd.apache.org/docs/2.1/mod/mod_proxy_balancer.html
I think php will be very useful. For example, you can use rand or push a variable in a file :
With apache, you have to setup a load balancer : http://httpd.apache.org/docs/2.1/mod/mod_proxy_balancer.html
我个人会使用php。然后,您可以将为它们选择的页面布局保存为会话变量,以便在每次页面刷新时轻松加载该布局。您可能还想将他们的用户名(如果他们登录)保存到数据库中,并且如果他们稍后访问,则向他们显示相同的布局。
I would use php personally. Then you can save which page layout you chose for them as a session var making it easy to load that layout on each page refresh. You would probably also want to save into the database with their username (if they login) and if they visit later show them the same layout.