> 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/ja/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" %}
**注**について詳しくは、次の記事をご覧ください： [計算フィールド](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/calculated-fields-explained.md) の概要と活用方法を説明しています。計算フィールドのトラッキングウィンドウの設定方法については、 [計算フィールドの設定](https://help.impact.com/brand/ja/what-would-you-like-to-learn-about/advocate-program/manage-advocate-participants/custom-and-calculated-fields/set-up-a-calculated-field.md).
{% endhint %}

トラッキングウィンドウを使うと、計算フィールドに時間ベースの要素を追加できます。合計またはカウントの計算を使用する計算フィールドには、トラッキングウィンドウを追加できます。

計算フィールドにトラッキングウィンドウを設定すると、参加者が一定期間ごとに値（購入金額など）を積み上げ、その値に基づいて報酬を付与できます。イベントデータは選択したウィンドウ内でのみ計算されます。時間の経過とともにウィンドウが更新されると、それ以前のデータは考慮されません。

フィールドの値を使ってプログラムルールを設定し、参加者が次の目標に沿って行動するよう促すことができます。

* **最終利用時期**：休眠中の参加者に再び利用を始めてもらったり、新たに購入してもらったりするよう促します。
* **利用頻度**：利用頻度の高い顧客に、プログラムやサービスを継続して利用してもらうよう促します。
* **金額**：一定の購入金額のしきい値を達成した高額利用者に報酬を付与します。

計算フィールドを設定する際は、次の2種類のトラッキングウィンドウから選択できます。

{% tabs %}
{% tab title="固定トラッキングウィンドウ" %}
固定ウィンドウでは、暦日、週、月、年単位で値を追跡できます。ウィンドウは各期間の開始時に始まり、終了時に切り替わります。開始時刻と終了時刻は、impact.comアカウントのタイムゾーン設定によって決まります。

固定ウィンドウを使用する計算フィールドを作成すると、フィールドの作成時点からカウントが始まります。次の期間の開始まで待つことはなく、（デフォルトでは）現在の期間の開始から作成時点までの値を遡って計算することもありません。

<details>

<summary>例</summary>

毎月、一定額以上を支出した参加者に特別な報酬を付与するプログラムルールを設定するとします。そのためには、1か月の固定ウィンドウで購入金額を合計する計算フィールドが必要です。設定すると、購入イベントは月の初日の午前0時から月末日の午後11時59分まで加算されます。

<div data-with-frame="true"><figure><img src="https://1458456015-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日（午前0時から午後11時59分まで） | 1日が経過するごと     |
| 5週間  | 1週間（日曜日から土曜日）        | 1週間が経過するごと    |
| 3か月  | 1か月（月初から月末まで）        | 1か月が経過するごと    |
| 2年   | 1年（1月1日から12月31日まで）   | 1年が経過するごと     |

スライディングウィンドウでは、トラッキングウィンドウの各単位について、合計またはカウントできる値の上限を設定できます。たとえば、90日間のウィンドウなら各日、12週間のウィンドウなら各週に上限を設定できます。この上限は期間全体に適用されるのではなく、各単位にのみ適用されます。

期間にかかわらず、各単位の開始時刻は午前0時（深夜）、終了時刻は午後11時59分とみなされます。時刻の判定には、impact.comアカウントのタイムゾーン設定を使用します。

<details>

<summary>例</summary>

参加者が90日間の支出額に応じてポイントを獲得できるようにするとします。日が経過し、新しい一致イベントデータを受信するたびに、直近90日間の支出額を反映するよう計算フィールドの値が更新されます。

<div data-with-frame="true"><figure><img src="https://1458456015-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 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/ja/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=<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.
