> 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="https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-0e7df8d9fa2b2b8cc3f1b333ce601aacde2f0b6f%2Ffce9f5404d15d0c5692cb3e89ff28b1305dd4baf8572e51e71766b633cc75c09.png?alt=media" 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="https://1186853034-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwMLlMoFBtKJa8ptd3zaw%2Fuploads%2Fgit-blob-947333eb074b672e6904336b45f10753b2fc0bb9%2Ffc0d585ccace147e93200605e9af49924c8bb0ea43d5104d735aabdde9f87751.png?alt=media" 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.
