Skip to content

Database options and maintenance

4Analytics may store a lot of data if your site has a lot of traffic. It is designed to do just that, and this design includes getting read of unused data as needed.

You can adapt 4Analytics default behavior to your requirements using the settings and tools on the Configuration | Database page.

Retention and privacy

Most privacy legal framework, such as the GDPR, state that you should keep data only as long as you need it. This is however for personally identifiable data, stored with user consent.

There should not be any restriction on how long you can keep 4Analytics data, at least from a legal point of view. But as usual, we're not lawyer and you should make sure your choice of how long you keeop data complies with your own specific legal requirements.

2 types of data and how they differ

4Analytics stores 2 types of data:

  • Raw data: the individual data records of each single page viewed by a visitor on your site
  • Aggregate data: based on raw data, 4Analytics regularly computes aggregate data. For instance, it groups togeter all pages viewed on a given day into one record per day.

    Then it does the same for each week, each month and lastly for each year. Aggregate data is what you see on your screen when looking at 4Analytics reports.

The following should be kept in mind:

  • Aggregate data is "just" computed based on raw data. Therefore, we can delete all aggregate data at any time, and as long as we still have the raw data, the individual page view records, 4Analytics can always rebuild the aggregate data.
  • If deleted, raw data cannot be rebuilt. Raw data are the basic bricks, if we delete the record that says that this visitor viewed this page on this date, at this time, with this browser,... then that information is lost.
  • Raw data uses up a lot more space than aggregate data. There is only one record per day for aggregate data, while if you had 1000 page-views that day, there will be 1000 raw data records in the database
  • Aggregate data is what you are interested in, and likely want to keep longer

This is why 4Analytics has a retention policy that decides how long each type of data should be kept.

Database retention policy

Database data retention policy configuration

These settings define how long 4Analytics will keep each type of data. Deletion happens in the background, on a regular basis.

Keep data forever

Contrary to common analytics service, or solutions where Personally Identifiable Information is stored, you can keep analytics data for as long as you want, allowing long term comparisons.

For reference, Google Analytics retention period for user-level information is up to 14 months only.

You do not need to do anything about data deletion, this is all handled by 4Analytics based on the settings you chose.

In fact, we strongly advise that you do not try to directly alter the 4Analytics database tables, or else you risk rendering it inconsistent, providing incorrect reports.

Database maintenance

Database maintenance operations

In a few exceptional cases, you may have to perform database maintenance operations. Two of them are possible:

Rebuild aggregate data

Rebuilding aggregate data from raw data may be needed on rare occasions, but the most common one is if you purposedly delete all raw data.

Rebuilding aggregate data after deleting raw data resets everything to zero. You may want this for instance after completing a website development and testing is over. By deleting raw data and aggregate data, you ready the site for actual live operation

Another common use case, without deleting raw data this time, is if you change some settings related to how reports are calculated, in which case you need to rebuild aggregate data so that these new settings are taken into account.

Delete all raw data

Deleting all raw data should likely only happen when testing or developing the site. Once the site is live, in production, raw data will be managed through the Retention policy set above and manual deletion should not be needed.

Password confirmation

As these operations can lead to data loss if used by mistake, both operations will first prompt your for a confirmation, and then ask for Joomla user password to finally trigger the operation:

Password confirmation dialog for dangerous operations