# 重定向测试

本节我们将详细得向您介绍重定向是什么？以及Ptengine是如何实现重定向的？ 阅读本章节前，我们强烈建议您先阅读[A/B测试](/cn/experience/campaign/create-new-2.md)的相关内容。

#### 快速了解什么是重定向 <a href="#kuai-su-liao-jie-shen-me-shi-zhong-ding-xiang" id="kuai-su-liao-jie-shen-me-shi-zhong-ding-xiang"></a>

当我们对页面进行优化时，往往会涉及多个影响因子，那么如果仅聚焦于一个区块将无法得出一个更加科学的结果。此时我们极力推荐您使用重定向测试，通过URL规则设置多个版本的页面（如www\.ptengine.com/new-in, [www.ptengine.com/new-in-1](http://www.ptengine.com/new-in-1), [www.ptengine.com/new-in-2），我们可以测试出页面的修改是否对我们的GOAL指标有影响。](http://www.ptengine.com/new-in-2），我们可以测试出页面的修改是否对我们的GOAL指标有影响。)

**下面我们举个例子**：

列表页：我们目前有多批产品，产品受众虽然相似，但两类产品的原价与主题都大不相同，于是我制作了多个分别置顶不同商品的列表页，我希望多个页面的URL一致，用户不会感知到区别。 那么我们可以在Ptengine中启用重定向测试，来验证对于我们的用户来说哪类产品更受用户喜爱。

#### 如何配置重定向实验 <a href="#ru-he-pei-zhi-zhong-ding-xiang-shi-yan" id="ru-he-pei-zhi-zhong-ding-xiang-shi-yan"></a>

要进行重定向测试，您需要准备至少两个页面版本，一个是原始版本，另一个是测试版本包含修改的页面。\
Tips：此外，对于要进行重定向的原始页面，需要在页面的HTML文件的标签内安装Ptengine的基本标签。

**1.准备好进行测试的URL。**

控制组：[www.ptengine.com/new-in](http://www.ptengine.com/new-in) 测试组：[www.ptengine.com/new-in-1](http://www.ptengine.com/new-in-1)

**2.创建新体验并选择重定向测试。**

![](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/doc/Experience/chongdingxiang/chuangjian1.jpg) ![](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/doc/Experience/chongdingxiang/chuangjian02.jpg)

**3.输入要重定向的原始URL与测试页面URL。**\
![](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/doc/Experience/chongdingxiang/chongdingx.jpg)

### 如果要限制测试的页面条件，请参考以下示例。 <a href="#ru-guo-yao-xian-zhi-ce-shi-de-ye-mian-tiao-jian-qing-can-kao-yi-xia-shi-li" id="ru-guo-yao-xian-zhi-ce-shi-de-ye-mian-tiao-jian-qing-can-kao-yi-xia-shi-li"></a>

![](https://help-ptengine-com-vitepress.oss-cn-guangzhou.aliyuncs.com/doc/Experience/chongdingxiang/URLtiaojian.jpg)

**注意：** 如果设置了上述URL的参数，请参考以下参数传递规则。

例如，将从"a.com"重定向到"b.com"。

* **如果b.com没有参数：** 完全继承a.com的参数。

  重定向页面：：a.com?utm\_source=xxx 重定向目标页面：b.com\
  结果：a.com?utm\_source=xxx → b.com?utm\_source=xxx
* **如果a.com和b.com具有不同的参数：** 参数将合并。

  例如： 重定向页面：a.com 重定向目标页面：b.com?utm\_medium=yyy\
  结果：a.com?utm\_source=xxx → b.com?utm\_medium=yyy\&utm\_source=xxx
* **如果a.com和b.com具有相同的参数：** a.com的参数将被覆盖。

  例如： 重定向页面：a.com 重定向目标页面：b.com?utm\_source=yyy\
  结果：a.com?utm\_source=xxx → b.com?utm\_source=yyy

#### **编辑体验，一键发布** <a href="#bian-ji-ti-yan-yi-jian-fa-bu" id="bian-ji-ti-yan-yi-jian-fa-bu"></a>

进入体验的编辑界面，设定“目标用户”、“体验目标”、“发布时间”等条件。确认无误后，发布体验。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://helps.ptengine.com/cn/experience/campaign/redirect-test.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
