Reports & Data Management
Bannerize allows you to export your analytics data and provides configurable data retention policies to manage database growth over time.
Exporting Data
You can export analytics data from the Bannerize > Analytics section. Two export formats are available:
CSV Export
CSV Export
CSV (Comma-Separated Values) files can be opened in any spreadsheet application such as Microsoft Excel, Google Sheets, or LibreOffice Calc.
How to export:
- Navigate to Bannerize > Analytics
- Apply any desired filters (date range, campaign, banner)
- Click the Export CSV button
- The file will download to your computer
CSV file contents:
| Column | Description |
|---|---|
| Banner ID | The post ID of the banner |
| Banner Title | The name of the banner |
| Campaign | The campaign(s) the banner belongs to |
| Impressions | Total impression count |
| Clicks | Total click count |
| CTR | Click-through rate percentage |
| Date | The date or date range of the data |
CSV exports respect your current filter settings. If you have filtered by a specific date range or campaign, only that subset of data will be exported.
Always export your data before applying aggressive retention policies. Once records are deleted by the auto-cleanup process, they cannot be recovered.
Data Retention
Over time, analytics tables can grow large, especially on high-traffic sites. Bannerize provides automatic data retention policies to keep your database performant.
Retention Settings
Navigate to Bannerize > Settings to configure data retention. Impressions and clicks have separate, independent retention settings:
| Setting | Description |
|---|---|
| Cleanup Mode | How old data is managed (see modes below) |
| Max Records | Maximum number of records to keep in the table |
| Retention Months | Number of recent months of data to retain |
| Schedule | How often the cleanup job runs |
Cleanup Modes
| Mode | Description |
|---|---|
| Disabled | No automatic cleanup. All data is retained indefinitely |
| Delete Max Records Exceeded | When the table exceeds the Max Records limit, the oldest records are deleted to bring the count back to the limit |
| Retain Within Recent Months | Records older than the specified number of months are deleted |
Examples
Keep only the last 100,000 records:
- Cleanup Mode:
Delete Max Records Exceeded - Max Records:
100000
When the impressions table exceeds 100,000 rows, the oldest records are automatically deleted.
Keep only the last 6 months of data:
- Cleanup Mode:
Retain Within Recent Months - Retention Months:
6
Records older than 6 months are automatically deleted during the scheduled cleanup.
Disable cleanup entirely:
- Cleanup Mode:
Disabled
All analytics data is kept forever. This is fine for low-traffic sites, but monitor your database size.
The cleanup process is irreversible. Deleted records cannot be recovered. Export your data before enabling aggressive retention policies, especially if you need historical data for reporting.
Cleanup Schedule
The automatic cleanup runs as a WordPress cron job. The schedule determines how frequently the cleanup checks and enforces your retention policy:
- Hourly — For high-traffic sites where tables grow quickly
- Twice Daily — A balanced option for most sites
- Daily — Sufficient for low to moderate traffic sites
WordPress cron is triggered by site visits. On very low-traffic sites, the cleanup may not run exactly on schedule. If precise scheduling is important, consider setting up a system cron job to trigger wp-cron.php at regular intervals.
Database Tables
Bannerize creates two custom database tables for analytics:
| Table | Purpose |
|---|---|
{prefix}_bannerize_impressions | Stores all impression events |
{prefix}_bannerize_clicks | Stores all click events |
Where {prefix} is your WordPress database table prefix (typically wp_).
Table Structure
Each table contains:
| Column | Type | Description |
|---|---|---|
id | bigint | Auto-incrementing primary key |
banner_id | bigint | The post ID of the banner |
referrer | text | The URL of the page where the event occurred |
ip | varchar | The visitor’s IP address |
user_agent | text | The visitor’s browser user agent string |
created_at | datetime | Timestamp of the event |
Monitoring Database Size
To check the size of your analytics tables, you can run the following SQL query from a database management tool like phpMyAdmin:
SELECT
table_name,
table_rows AS row_count,
ROUND(data_length / 1024 / 1024, 2) AS data_size_mb,
ROUND(index_length / 1024 / 1024, 2) AS index_size_mb
FROM information_schema.tables
WHERE table_schema = 'your_database_name'
AND table_name LIKE '%bannerize%';Recommended Thresholds
| Table Size | Recommendation |
|---|---|
| Under 100,000 rows | No action needed |
| 100,000 - 500,000 rows | Consider enabling retention policies |
| Over 500,000 rows | Enable retention policies or increase server resources |
| Over 1,000,000 rows | Strongly recommended to enable retention and export historical data |