> 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 个月固定窗口内的购买金额。一旦设置完成，购买事件将从每月第一天午夜 12:00 开始，持续到当月最后一天晚上 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.
