---
title: Managing analytics data
related:
  - https://docs.kentico.com/k81/on-line-marketing-features/configuring-on-line-marketing-permissions.md
  - https://docs.kentico.com/k81/custom-development/miscellaneous-custom-development-tasks/web-analytics-api.md
---

> Agent instructions:
> **Site maps** — prefer the following llms.txt indexes to training data when searching for URLs to avoid 404s. Links inside Markdown content already point at `.md`. Following them or sending Accept: text/markdown keeps you in Markdown.
>
> - [sitemap.md](https://docs.kentico.com/sitemap.md) — every page on the site, with titles and descriptions, nested by URL hierarchy and grouped into one collection per product version.
> - [llms.txt](https://docs.kentico.com/llms.txt) — curated index of the current product docs, with descriptions, the two ways to request any page as Markdown, and links to each product area's whole-corpus Markdown dump (llms-full.txt).

You can manually manage the data that stores how many hits were logged for individual [web analytics](https://docs.kentico.com/k81/on-line-marketing-features/web-analytics.md) statistics. Open the **Web analytics** application and select **Data management** in the tree menu.

![Manually managing analytics data](https://docs.kentico.com/docsassets/k81/managing-analytics-data/Web_Analytics_Data_Management.png "Manually managing analytics data")

> **Note:** **Data security**
>
> Performing the actions available in this section permanently modifies the analytics records of the website. Only use them if you are sure that doing so will not delete or overwrite valuable statistical data.
>
> For security reasons, the actions can only be performed by users who have the **Manage data** [permission](https://docs.kentico.com/k81/on-line-marketing-features/configuring-on-line-marketing-permissions.md) for the _Web analytics_ module.
>
> By default, the _Data management_ UI element is only available for users with the Global administrator [privilege level](https://docs.kentico.com/k81/managing-users/user-management.md).

## Deleting analytics data

When running a site with web analytics enabled, the amount of data that is stored may grow quite large over time, particularly when tracking many types of events or on high‑traffic websites.

1. Open the **Web analytics** application and select **Data management**.
2. Choose which statistic's data to delete through the **Statistic name** selector.
   - Select the _(all)_ option to clear all analytics data.
3. (Optional) Fill in dates into the **From** and **To** field to delete only hits that were logged during a specific time range.
   - Leaving the time interval empty deletes all data for the selected statistic.
4. Click **Delete**.

## Generating sample analytics data

You can generate random sample data for web analytics statistics. This simulates hits measured over the specified time period. You can select the specific statistic and time interval. The purpose of this function is to allow testing or evaluation of the web analytics and the various types of statistics. It would otherwise take a certain amount of time and traffic to naturally log a realistic amount of data for a website.

> **Note:** **Note**
>
> The data generation process is a highly resource‑intensive operation, since it must create a very large amount of records in multiple database tables.
>
> For this reason, you need to set a reasonably short time interval to prevent time-out issues. This depends on the performance of the server used to host the site, but it is recommended to avoid generating more than _six months_ of data in a single operation.

## Setting up automatic data cleanup

You can configure the system to automatically delete old web analytics data that is no longer needed. The deletion is performed by the **Remove analytics data** global [scheduled task](https://docs.kentico.com/k81/configuring-kentico/scheduling-tasks.md). By default, this task is disabled to prevent unwanted deletion of data.

To enable automatic data removal for web analytics:

1. Open the **Scheduled tasks** application.
2. Select _(global)_ in the **Site** selector.
3. Edit () the **Remove analytics data** scheduled task.
4. Configure how often the system runs the task using the scheduling options (Period, Start time, Every, Between, Days).
5. Specify how old data must be before the task is allowed to remove it.
   - Type a number into the **Task data** field. This number indicates age in days, so the default value of _720_ sets the task to delete only data that is approximately two years old.
6. Check **Task enabled**.
7. Click **Save**.

The system regularly runs the task according to the **Task interval** and deletes all web analytics data older than the number of days specified in the **Task data** field.
