> For the complete documentation index, see [llms.txt](https://help.impact.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/advocate-program/advocate-program-settings/test-your-advocate-program.md).

# 测试你的 Advocate 项目

你可以通过模拟你的 [计划规则](/brand/zh/what-would-you-like-to-learn-about/advocate-program/getting-started-with-advocate/advocate-program-rules-explained.md) 对示例数据进行测试，以确认规则在生产环境中按预期运行后再依赖它。

{% hint style="success" %}
**注意：** 你需要至少设置 1 条计划规则才能测试你的计划。
{% endhint %}

{% stepper %}
{% step %}

## 访问“测试我的计划”

1. 从左侧导航菜单中，选择 ![](https://4048883401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-230534471fef5f40808e921e41ee44e4a06ded03%2Fe6cb9548999afdc1ed3ce4942e4cb5b45b5cecbd323267aac2a7cd1915fccc09.svg?alt=media) **\[Engage]** <i class="fa-arrow-right">:arrow-right:</i> **项目规则** <i class="fa-arrow-right">:arrow-right:</i> **测试我的计划**.
   1. 选择 **下一步** 在步骤之间移动。
      {% endstep %}

{% step %}

## 确认计划和版本

2. 该计划会从你当前的上下文中预填充。只有在需要测试其他计划时才切换。
3. 在 *版本* ![](https://4048883401-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-c2cb550b55c51ea1eeff0acbd6f437a03b621a2c%2F60d033ae8a04c14498d5229c3c0160ac05feea7f605dbd770741793c900469f0.svg?alt=media) **\[下拉菜单]**，选择是否模拟 **草稿** 或 **已上线** 版本。
   1. 进一步了解你的 Advocate 计划的草稿版本和正式版本所包含的内容。
      {% endstep %}

{% step %}

## 选择事件并填写其输入

4. 选择要模拟的事件，然后按其在你的计划中实际发生的方式输入信息：
   * **推荐开始**
   * **朋友完成购买**
   * **朋友退回购买**
   * **好友执行某项操作**

<details>

<summary>字段说明</summary>

| 字段                   | 作用                     | 适用于                   |
| -------------------- | ---------------------- | --------------------- |
| **购买事件**             | 要模拟的被跟踪购买事件。           | 好友完成购买、好友退款           |
| **购买日期**             | 模拟购买的日期。               | 好友完成购买、好友退款           |
| **事件类型**             | 要模拟的被跟踪事件。             | 好友执行某项操作              |
| **事件日期**             | 事件发生的日期。               | 好友执行某项操作              |
| **货币**               | 模拟购买金额的货币。             | 好友完成购买、好友执行操作         |
| **购买金额**             | 模拟购买的金额。               | 好友完成购买（必填）、好友执行操作（可选） |
| **推荐开始于**            | 推荐开始的日期。               | 所有事件                  |
| **推荐已转化**            | 指定推荐是否已经转化以及何时转化。      | 除“推荐开始”外的所有事件         |
| **Advocate 分群** （可选） | 将测试限制为特定的 Advocate 分群。 | 所有事件                  |
| **好友分群** （可选）        | 将测试限制为特定的好友分群。         | 所有事件                  |

</details>
{% endstep %}

{% step %}

## 运行测试

5. 选择 **运行测试**。你的规则会根据所选的计划、版本以及你提供的输入进行评估。
   {% endstep %}

{% step %}

## 阅读预览输出

6. 查看 *预览* 面板：
   1. 触发的规则摘要、如果有基于日期的操作则显示日期范围，以及每个结果操作前带勾选标记的行。确认它是否符合你的预期。
      {% endstep %}
      {% endstepper %}

## 测试案例

这些测试案例使用你可以设置的示例规则，以便在发布前确认你的计划按预期运行。下面的每个场景都会更详细地演示一个特定情况。可根据你自己的计划配置调整触发条件、金额和分群等具体内容。

<details>

<summary>基础触发逻辑</summary>

**目标：**

* 确认一个基础的购买触发规则会匹配并返回预期结果。
* 确认没有错误的回退行为。

**规则设置：**

* 触发条件：好友完成购买。
* 操作：向 Advocate 奖励并发送电子邮件，并向 Advocate 发放现金奖励。
* 无需默认操作。

**测试输入：**

* 事件：好友完成购买。
* 与规则匹配的购买事件、购买日期、购买金额和货币。
* 推荐开始日期相同。
* 分群保持为空。

**预期结果：**

* 该规则匹配，预览会准确显示匹配的是哪条规则。
* Advocate 奖励行会显示你配置的奖励金额。
* 会显示 Advocate 电子邮件行。
* 不会出现其他错误的回退操作。

</details>

<details>

<summary>时间窗口匹配与回退</summary>

**目标：**

* 确认时间窗口内的日期会应用基于时间的操作。
* 确认窗口外的日期会回退到默认值。

**规则设置：**

* 触发条件：好友完成购买。
* 基于推荐开始日期、限定在日期窗口内的基于时间的操作。
* 窗口外的默认操作。

**运行 A（在窗口内）：**

* 将推荐开始日期设置在窗口内。

**预期 A：**

* 预览会准确显示匹配的是哪条基于时间的规则。
* 其奖励和电子邮件会被应用。

**运行 B（在窗口外）：**

* 将推荐开始日期设置在窗口外。

**预期 B：**

* 基于时间的操作不匹配。
* 改为应用默认奖励和电子邮件。

</details>

<details>

<summary>分层奖励选择</summary>

**目标：**

* 确认会根据购买金额选择正确的奖励层级。

**规则设置：**

* 触发条件：好友完成购买。
* 操作：向 Advocate 分层奖励并发送电子邮件。
* 至少有三个按购买金额范围划分的奖励层级（例如低、中、高层级）。

**测试输入：**

* 每个层级运行一次。
* 输入一个落在每个层级范围内的购买金额。
* 每次运行都保持其他所有输入相同。

**预期结果：**

* 每次运行都会显示该金额所属层级配置的奖励，而不是其他层级的奖励。

</details>

<details>

<summary>分群门控资格</summary>

**目标：**

* 确认分群条件决定规则是否适用。

**规则设置：**

* 触发条件：好友完成购买。
* 要求 Advocate 处于特定分群的条件。
* 理想情况下，为其他所有人设置默认操作。

**运行 A（匹配）：**

* 将 Advocate 的分群设置为符合资格的分群。

**预期 A：**

* 会应用符合资格的操作。
* 会跳过默认值。

**运行 B（不匹配）：**

* 将 Advocate 的分群设置为不符合资格的分群。

**预期 B：**

* 如果已配置默认操作，则会应用该操作。
* 如果没有，则根本不会触发任何符合条件的操作。

</details>

<details>

<summary>佣金计算</summary>

**目标：**

* 确认佣金奖励会根据购买金额计算，并以正确的货币显示。

**规则设置：**

* 触发条件：好友完成购买。
* 操作：向 Advocate 奖励并发送电子邮件。
* 基于佣金的奖励——即购买金额的一定百分比——使用交易货币。

**运行 A 和 B：**

* 两个不同的购买金额，相同的货币。

**预期 A 和 B：**

* 每次都会正确显示应用于该金额的佣金率。

**运行 C（如果你的计划支持多种货币）：**

* 与运行 A 相同的金额，但使用不同的货币。

**预期 C：**

* 佣金会被正确计算并以新货币显示。
* 这将货币处理与金额计算分离开来。

</details>

<details>

<summary>没有默认配置时不匹配</summary>

**目标：**

* 确认当没有任何内容匹配且没有回退时，预览会清楚显示没有操作。

**规则设置：**

* 一个未配置默认操作的基于时间的操作。

**测试输入：**

* 将推荐开始日期设置在时间窗口之外。

**预期结果：**

* 没有时间窗口匹配。
* 没有可用的默认回退。
* 预览会清楚显示不会发生任何符合条件的操作。

</details>

<details>

<summary>由于规则条件未满足而不匹配</summary>

**目标：**

* 确认当规则自身的条件未满足时，预览会显示没有操作——不仅仅是时间窗口。

**规则设置：**

* 一条在触发事件上有两个条件的规则：特定购买事件，以及最低购买金额。

**测试输入：**

* 输入一个不匹配的购买事件、低于最低值的金额，或两者都不匹配。

**预期结果：**

* 没有匹配到任何规则条件。
* 预览会清楚显示不会发生任何事情。

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/advocate-program/advocate-program-settings/test-your-advocate-program.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
