Analytics Cleanup Job

Modified on Thu, 29 Oct at 10:02 AM

The Analytics Cleanup Job permanently removes Analytics records that are older than a configured retention period. It limits long-term database growth while controlling the amount of deletion work performed in each execution.

What the job does

  • Identifies eligible Analytics actions older than the retention threshold.
  • Deletes records in configurable batches.
  • Limits the work performed during one execution when a maximum batch count is configured.
  • Records execution status and results for monitoring.

This job is configured on the Analytics Server. Newired Portal displays its configuration and latest execution as view-only information under Administration > Maintenance.

Configuration

Set these properties in the Analytics Server configuration. Schedule large cleanup operations outside peak usage periods.

Enable cleanup

newired.analytics-cleanup.enabled controls whether the job runs automatically.

Default:

true

Schedule

newired.analytics-cleanup.schedule defines the schedule as a cron expression.

Default:

0 0 3 * * *

Retention period

newired.analytics-cleanup.retention-days defines the age, in days, after which records become eligible for deletion.

Default:

1095

Actions per batch

newired.analytics-cleanup.actions-per-batch limits the number of actions deleted in one batch. Lower values reduce transaction size but can increase total runtime.

Default:

10000

Action types

newired.analytics-cleanup.action-kinds defines which Analytics action types are eligible for cleanup.

Default:

page_view, journey, feedback, user_identify, user_activity

Maximum batches per run

newired.analytics-cleanup.max-batches-per-run limits the number of batches processed in one execution. A value of 0 applies no limit.

Default:

0

Database statement timeout

newired.analytics-cleanup.statement-timeout limits the duration of database delete statements. Supported units include milliseconds, s, min, and h. A value of 0 disables the timeout.

Default:

30min

Verify execution

In Newired Portal, open Administration > Maintenance and expand Analytics Cleanup. Review its status, schedule, configuration, and latest execution.

FieldMeaning
Cleanup cutoffAnalytics actions recorded before this time were eligible for deletion.
Batches processedNumber of deletion batches completed during the execution.
Actions deletedTotal number of eligible Analytics actions permanently removed.

A successful execution can report zero deleted actions. This means the job completed correctly but found no actions eligible for deletion under the current configuration.

The diagnostics endpoint also provides run history, execution status, deleted-record count, duration, and error details:

<instance>/rest/app/diag/jobs/analytics/cleanup

The diagnostics endpoint requires an authorized API request using the nw-auth request header. See Newired diagnostics API documentation.

Operational guidance

  • Adjust the retention period according to your storage and reporting requirements.
  • Reduce the batch size or maximum batches per run if cleanup causes excessive database load.
  • Move the schedule outside peak usage periods when large datasets are processed.
  • If Portal reports the job as unavailable, verify that the Analytics Server is running and reachable.

For an overview of all jobs, see Maintenance jobs in Newired Portal. For storage warnings and other cleanup options, see Managing server storage capacity.

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article