> 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/manage-advocate-participants/custom-and-calculated-fields/tracking-windows-for-calculated-fields-explained.md).

# 计算字段跟踪窗口说明

{% hint style="info" %}
**注意**：查看我们关于 [计算字段](/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/calculated-fields-explained.md) 有关它们是什么以及何时有用的说明。如果你正在寻找为你的计算字段设置跟踪窗口的帮助，请参见 [设置计算字段](/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/set-up-a-calculated-field.md).
{% endhint %}

跟踪窗口可让你为计算字段添加基于时间的元素。你可以将跟踪窗口添加到任何使用求和或计数计算的计算字段中。

如果你希望允许参与者按周期累积某个值（例如购买金额），然后根据该值奖励他们，那么在计算字段中包含跟踪窗口会很有用。事件数据只会在你选择的窗口内进行计算——随着时间推移以及窗口更新，之前的数据将不会被计入。

你可以使用该字段中的值来设置计划规则，以激励参与者与你的目标保持一致，适用于：

* **近期性**：鼓励沉睡的参与者重新激活或进行新的购买。
* **频率**：激励你最常参与的客户持续与你的计划和服务互动。
* **货币价值**：奖励高消费用户达到某个购买金额门槛。

设置计算字段时，你可以选择两种类型的跟踪窗口：

{% tabs %}
{% tab title="固定跟踪窗口" %}
固定窗口可让你在日历日、周、月或年期间跟踪某个值。窗口从该时间段开始时启动，并在结束时滚动到下一周期。开始和结束时间将取决于你的 impact.com 帐户的时区设置。

当你创建带有固定窗口的计算字段时，它会从字段创建的那一刻开始计数——它不会等到下一个完整周期开始，也不会默认回溯计算当前周期开始时你可能错过的任何值。

<details>

<summary>示例</summary>

你希望设置一条计划规则，为每月消费超过一定金额的参与者发放特别奖励。为此，你需要一个计算字段，用于汇总 1 个月固定窗口内的购买金额。一旦设置完成，购买事件将从每月第一天午夜开始计入，直到当月最后一天晚上 11:59。

<div data-with-frame="true"><figure><img src="/files/958de0595ddde1565de3ec1a06f348547936e4d2" alt=""><figcaption></figcaption></figure></div>

</details>
{% endtab %}

{% tab title="滑动跟踪窗口" %}
滑动窗口可让你在最长 90 天、周、月或年的自定义间隔内衡量某个值。与固定窗口不同，滑动窗口不依赖于预设的单个日历间隔——你可以设置 10 天、5 周、3 个月、2 年等窗口。

在每个间隔内都有一个独立的 **时间** 单位。随着每个单位过去，并且我们收到符合你条件的新事件，计算字段将会更新。

| 示例间隔 | 时间单位                   | 你的字段将更新…… |
| ---- | ---------------------- | --------- |
| 10天  | 1天（上午 12:00 至晚上 11:59） | 每过一天后     |
| 5周   | 1周（周日到周六）              | 每过一周后     |
| 3个月  | 1个月（每月第一天至当月最后一天）      | 每过一个月后    |
| 2年   | 1年（1月1日至12月31日）        | 每过一年后     |

滑动窗口允许你为跟踪窗口的每个单位设置一个可被求和或计数的最大值，例如，你的 90 天窗口中的每一天，或 12 周窗口中的每一周。此设置不会为整个间隔设置上限，只会为每个单位设置上限。

无论你的间隔如何，我们都会将每个单位的开始时间视为上午 12:00（午夜），结束时间视为晚上 11:59。我们使用你的 impact.com 帐户的时区设置来确定这一点。

<details>

<summary>示例</summary>

你希望允许参与者根据他们在 90 天内的消费金额累积积分。随着每一天过去，并且我们收到新的匹配事件数据，计算字段的值都会更新，以反映过去 90 天内的消费金额。

<div data-with-frame="true"><figure><img src="/files/fb21ef9091d93cea91d105f75ce49926ecf60345" alt=""><figcaption></figcaption></figure></div>

</details>
{% endtab %}
{% endtabs %}


---

# 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 dynamically by asking a question.

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

```
GET https://help.impact.com/brand/zh/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/tracking-windows-for-calculated-fields-explained.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
