我的网站只有一个名为products.php
的网页,我使用查询字符串products.php?category=books
显示不同的类别(大约50个)。现在,我已经为网址products.php?category=books
设置了内容实验,并且一切正常,但是当我尝试访问任何其他类别时,我会被重定向到前面提到的books
类别。我怎样才能使这个工作?
理想情况下,我想设置一个适用于每个类别的“动态”实验,但如果我只能设置一个类别并且所有其他类别不会重定向到books
,我可以忍受类别。任何帮助表示赞赏。
答案 0 :(得分:1)
实际上解决方案非常简单:只需将内容实验设置为原始网址products.php
,而不添加其他参数,因为它们(如果存在)将会传播,如official google analytics support page所述:
3. URL parameters in your variation pages
If you set URL parameters in your variation pages, then Experiments incorporates
them into what the visitor sees. Let’s say you set your experiment pages as:
Original page: www.example.com/a
Variation page: www.example.com/b?id=50
If visitors arrive with no URL parameters, then they see one of these two pages:
Original page: www.example.com/a
Variation page: www.example.com/b?id=50
If visitors arrive with URL parameters that conflict, then the URL parameters you
supplied during the experiment setup override the URL parameters that visitors
arrive with.
For example, if the visitor clicks a link to www.example.com/a?id=1, the visitor sees one of these two pages:
Original page: www.example.com/a?id=1
Variation page: www.example.com/b?id=50
If visitors arrive with URL parameters that don’t conflict, then the URL parameters are
appended to the page URL. For example, if the visitor clicks a link to
www.example.com/a?cat=1, then the visitor sees one of these two pages:
Original page: www.example.com/a?cat=1
Variation page: www.example.com/b?id=50&cat=1