0

我有一个只有一个页面命名的网站products.php,我显示不同的类别(大约 50 个),查询字符串如products.php?category=books. 现在,我已经为 url 设置了内容实验products.php?category=books并且一切正常,除了当我尝试访问任何其他类别时,我被重定向到上述books类别。我怎样才能得到这个工作?

理想情况下,我想设置一个适用于每个类别的“动态”实验,但如果我可以只设置一个类别并且所有其他类别都不会重定向到该books类别,我可以接受。任何帮助表示赞赏。

4

1 回答 1

1

解决方案实际上非常简单:只需使用原始 url 设置内容实验products.php而不使用其他参数,因为它们(如果存在)将被传播,如官方谷歌分析支持页面所述:

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
于 2013-02-26T11:55:27.913 回答