Skip to content

Configuration

Richard Kent Gates edited this page Jun 9, 2026 · 2 revisions

Configuration

All settings live under Rich Statistics → Preferences in your WordPress admin. No wp-config.php edits are needed.

Data Retention

Controls how long raw event rows are kept in the database. Older rows are pruned automatically by a daily WP-Cron job (minimum 1 day, maximum 730).

Option value Behavior
30 Keep the last 30 days
90 Keep the last 90 days (default)
180 Keep the last 6 months
365 Keep the last year

You can also trigger pruning immediately from the WP-CLI: wp rich-stats purge.

Bot Score Threshold

Requests with a bot score equal to or above this value are silently discarded and not recorded. The score range is 1–10; higher values mean less aggressive filtering. Default is 5.

Threshold Effect
23 Aggressive — may filter headless browsers mimicking real users
5 (default) Balanced — catches most bots with minimal false positives
810 Lenient — only filters obvious or self-announced crawlers (Googlebot, etc.)

Network-level disable (multisite)

On multisite, a network administrator can disable tracking across all sub-sites at once from Network Admin → Rich Statistics. This sets a network-wide option that the tracker checks before enqueuing any JavaScript — no data is collected from any site while this is active.

Available wp_options keys

Option key Type Default Description
rsa_retention_days int 90 Days to keep event data (1–730)
rsa_bot_score_threshold int 5 Bot score at or above which events are discarded (1–10)
rsa_enabled_post_types array [] Custom post type slugs to include in page filter dropdowns
rsa_track_protocol_tel bool true Track tel: link clicks
rsa_track_protocol_mailto bool true Track mailto: link clicks
rsa_track_protocol_geo bool true Track geo: map link clicks
rsa_track_protocol_sms bool true Track sms: link clicks
rsa_track_protocol_download bool true Track file download clicks
rsa_click_track_ids string '' Comma-separated element IDs to track as clicks
rsa_click_track_classes string '' Comma-separated CSS classes to track as clicks
rsa_email_digest_enabled bool false Enable scheduled analytics digest emails
rsa_email_digest_frequency string 'weekly' daily, weekly, or monthly
rsa_email_digest_recipients string admin email Comma-separated recipient addresses for digest emails
rsa_remove_data_on_uninstall bool false Drop all tables and options when the plugin is deleted
rsa_allowed_roles array ['administrator'] Roles that can access the app and REST API
rsa_beta_channel bool false Enable beta channel updates
rsa_consent_banner bool false Enable visitor-facing consent banner
rsa_consent_auto bool true Auto-consent all categories on first visit
rsa_network_disable_tracker bool false Network-wide tracker disable (multisite)
rsa_default_retention_days int 90 Default retention for new sites (multisite)
rsa_woocommerce_enabled bool true Enable WooCommerce event tracking (premium)
  Options are managed via the standard WordPress Settings API and are sanitized before being saved. They are never exposed via the REST API.

Documentation

Features

User Guide

Compliance


External Links

Clone this wiki locally