# Tracking Windows for Calculated Fields Explained

{% hint style="info" %}
**Note**: Check out our article on [calculated fields](https://help.impact.com/brand/advocate-program/manage-advocate-participants/custom-and-calculated-fields/calculated-fields-explained) for an explanation of what they are and when they’re useful. If you’re looking for help setting up a tracking window for your calculated field, see [Setting Up a Calculated Field](https://help.impact.com/brand/advocate-program/manage-advocate-participants/custom-and-calculated-fields/set-up-a-calculated-field).
{% endhint %}

A tracking window allows you to add time-based elements to calculated fields. You can add tracking windows to any calculated fields that use a sum or count calculation.

Including a tracking window on a calculated field is useful if you want to allow your participants to accrue a value periodically (such as purchase amount) and then reward them based on the value. Event data will only be calculated during the window you select—as time passes and the window updates, previous data won’t be taken into account.

You can use the value from the field to set up program rules that incentivize your participants to align with your goals for:

* **Recency**: Encourage dormant participants to reactivate or make a new purchase.
* **Frequency**: Incentivize your most frequent customers to keep engaging with your program and services.
* **Monetary Value**: Reward high spenders for hitting a certain purchase value threshold.

When setting up a calculated field, you can choose from two types of tracking windows:

{% tabs %}
{% tab title="Fixed tracking windows" %}
Fixed windows let you track a value during a calendar day, week, month, or year. The window starts at the beginning of the interval and rolls over at the end. The start and end time will depend on the time zone settings for your impact.com account.

When you create a calculated field with a fixed window, it will start counting from the moment the field is created—it won’t wait for the start of the next full interval, and it won’t retroactively calculate (by default) any values from the beginning of the current interval if you missed them.

<details>

<summary>Example</summary>

You want to set up a program rule that issues a special reward to participants who spend over a certain amount each month. To do this, you’ll need a calculated field that sums the value of purchases over a 1-month fixed window. Once this is set up, purchase events will be added from the first day of the month, at midnight to 11:59 p.m. on the final day of the month.

<div data-with-frame="true"><figure><img src="https://4048883401-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="Sliding tracking windows" %}
Sliding windows let you measure a value over a custom interval of up to 90 days, weeks, months, or years. Unlike fixed windows, sliding windows don’t rely on set individual calendar intervals–you can set a window for 10 days, 5 weeks, 3 months, 2 years, and so on.

Within each interval is an individual **unit** of time. The calculated field will be updated as each unit passes and we receive new events that meet your criteria.

| Example Interval | Unit of time                                              | Your field will update…       |
| ---------------- | --------------------------------------------------------- | ----------------------------- |
| 10 days          | 1 day (12:00 a.m. to 11:59 p.m.)                          | After every day that passes   |
| 5 weeks          | 1 week (Sunday to Saturday)                               | After every week that passes  |
| 3 months         | 1 month (First of the month to the last day of the month) | After every month that passes |
| 2 years          | 1 year (January 1st to December 31st)                     | After every year that passes  |

Sliding windows allow you to set a maximum value to be summed or counted for each unit of your tracking window, e.g., for each day of your 90 day window, or each week of your 12 week window. This does not set a maximum for the entire interval. It only sets a maximum for each unit.

Regardless of your interval, we consider the start time of each unit as 12:00 a.m. (midnight) and the end as 11:59 p.m. We use the time zone settings for your impact.com account to determine this.

<details>

<summary>Example</summary>

You want to allow participants to accrue points based on the amount they spend over the course of 90 days. As each day passes and we receive new matching event data, the calculated field value is updated to reflect the amount spent over the previous 90 days.

<div data-with-frame="true"><figure><img src="https://4048883401-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 %}
