> ## Documentation Index
> Fetch the complete documentation index at: https://dokumentation.websale.de/llms.txt
> Use this file to discover all available pages before exploring further.

# statistics - Statistics data

> Statistics configuration in the WEBSALE shop: integrate tracking providers, control conversion events, and provide statistics data for analyses.

export const KonfigDeeplink = ({node}) => <>
    You can open this setting directly in the Admin Interface via the following link:{" "}
    <code>{`https://<shop-domain>/admin/config/${node}`}</code>{" "}
    (<a href="/en/admin-interface/konfigurations-deeplinks">Deeplink overview</a>)
  </>;

The `statistics` section bundles the settings related to the statistics data of your shop.

***

## `statistics*` - Basic structure

Below is the basic structure of the `statistics` node.

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
    "statistics": {
      "dataRetention": {...}
    }
}
```

#### Parameter overview

| **Parameter**   | **Description**                                                                       |
| --------------- | ------------------------------------------------------------------------------------- |
| `dataRetention` | Retention period of the statistics data per time level (hourly/daily/monthly values). |

***

## `statistics.dataRetention` - Retention of statistics data

This configuration node defines how long statistics data is retained per time level. In the statistics, figures on visits, orders, and revenue accumulate continuously. These can be stored at the following time levels:

* Hourly values - one data point per hour (for example, to analyze peak times or campaigns),
* Daily values - one data point per day (for example, to compare Black Friday 2025 with 2024),
* Monthly values - one data point per month (for example, to compare revenue growth and customer acquisition).

For each of these levels, you define the retention period separately. The levels differ in terms of level of detail and storage requirements.

Hourly values are very detailed, but they require a lot of storage space (24 data points per day) and are particularly interesting for short-term analyses.

Monthly values, on the other hand, are coarse, require hardly any storage space (12 data points per year), and are suitable for analyzing trends over several years.

The default values are chosen so that the fine-grained hourly values are stored for the shortest time and the coarse monthly values for the longest. This keeps the stored data volume small without losing the long-term trend.

`dataRetention` is a singleton and is configured once per shop.

<KonfigDeeplink node="statistics.dataRetention" />

#### Example configuration `statistics.dataRetention`

```json theme={"theme":{"light":"github-light","dark":"github-dark"},"languages":{"custom":["/languages/websale.json"]}}
{
  "retainHourlyInMonths": 3,
  "retainDailyInMonths": 24,
  "retainMonthlyInMonths": 60,
  "monthlyUnlimitedRetention": false
}
```

#### Parameter overview

| **Parameter**               | **Type** | **Description**                                                                                                                                                                                                            |
| --------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `retainHourlyInMonths`      | uint     | Retention period of the hourly values in months. Hourly values are the finest and most storage-intensive level. <br />The maximum limits them to no more than one year.<br />Possible values: `0` - `12`<br />Default: `3` |
| `retainDailyInMonths`       | uint     | Retention period of the daily values in months.<br />Default: `24`                                                                                                                                                         |
| `retainMonthlyInMonths`     | uint     | Retention period of the monthly values in months.<br />Default: `60`                                                                                                                                                       |
| `monthlyUnlimitedRetention` | bool     | Activates unlimited retention of the monthly values.<br />`true` - Monthly values are retained permanently.<br />`false` - Monthly values are retained according to `retainMonthlyInMonths`.<br />Default: `false`         |
