User Guide – Traffic Analytics
Table of Contents
The Traffic Analytics Module provides comprehensive website traffic monitoring directly within your WordPress admin. It tracks visitors, pageviews, referrers, and device information without relying on external services — all data stays on your server.
The Traffic Analytics module is disabled by default to minimise server load on sites that don’t need it. You must explicitly enable it in the plugin settings before data collection begins.
You need the Administrator role (the
manage_options capability) to access the Traffic Analytics module. Other user roles will not see the menu item.
Key Features
📊 Visual Dashboard
Interactive SVG chart showing daily visitors and pageviews with comparison to previous periods.
📄 Top Pages
See which pages on your site receive the most traffic, with expandable details for query parameters.
🔗 Referrer Tracking
Identify where your traffic comes from — search engines, social media, other websites, or direct visits.
📱 Device & Browser Stats
Breakdown of visitors by device type (desktop, mobile, tablet), browser, and operating system.
⚡ Real-Time Count
Live count of visitors active on your site in the last 30 minutes.
🔒 Privacy-Focused
No external tracking scripts. No third-party data sharing. All data remains on your server.
Enable / Disable the Module
The Traffic Analytics module is a standalone module inside Advanced Analytics. It is disabled by default and must be enabled manually before any data collection begins.
- Navigate to Error Logs → Settings in the WordPress admin sidebar.
- Click the “Traffic Analytics” tab (or scroll to the section headed Traffic Analytics Settings).
- Check the “Enable Traffic Analytics” checkbox.
- Configure any additional settings (tracking method, exclusions, retention).
- Click Save Changes.
Module Settings
The Traffic Analytics settings page contains the following configuration options:
| Setting | Type | Description |
|---|---|---|
| Enable Traffic Analytics | Checkbox | Master switch to enable or disable the entire module. When disabled, no data is collected and the dashboard menu is hidden. |
| Tracking Method | Radio buttons | Choose between Server-side (PHP) or Client-side (JavaScript) tracking. See Tracking Methods for details. |
| Exclude Administrators | Checkbox | When enabled, logged-in administrators are not counted in traffic statistics. Useful for excluding your own visits. |
| Keep Data For (days) | Number | Traffic data older than this number of days will be automatically deleted. Minimum: 30 days. Maximum: 3650 days (10 years). |
Dashboard Overview
The Traffic Analytics dashboard is the main interface for viewing your site’s traffic data. It consists of several sections:
- Date Range Toolbar — Quick presets and custom date selection
- Real-Time Indicator — Live visitor count for the last 30 minutes
- Summary Cards — Key metrics with period comparison
- Line/Bar Chart — Visual representation of daily traffic
- Top Pages Panel — Most visited pages on your site
- Top Referrers Panel — Traffic sources with favicon display
- Tech Breakdown Panels — Devices, browsers, and operating systems
- Tracking Info Footer — Current tracking method and buffer status
Date Range Selection
The toolbar at the top of the dashboard provides multiple ways to select the date range for your traffic data:
Quick Presets
| Preset | Date Range |
|---|---|
| Today | Current day only |
| Yesterday | Previous day only |
| Last 7 Days | Today and the previous 6 days |
| Last 28 Days | Today and the previous 27 days (default) |
| Last 90 Days | Today and the previous 89 days |
| Last 12 Months | Today and the previous 12 months |
Custom Date Range
For specific date ranges, use the date picker fields:
- Enter a Start Date using the date picker or type in YYYY-MM-DD format.
- Enter an End Date (cannot be in the future).
- Click Apply to load data for the selected range.
Summary Cards
The summary cards display key metrics at a glance, each showing the current value and percentage change from the previous period:
| Metric | Description |
|---|---|
| Total Visitors | Unique visitors counted using a cookie-based identifier. A visitor is counted once per day regardless of how many pages they view. |
| Total Pageviews | Total number of page loads across all visitors. Each page load counts as one pageview. |
| Pages / Visitor | Average number of pages viewed per visitor. Calculated as Total Pageviews ÷ Total Visitors. |
Change Indicators
- +15.2% — Green indicates positive growth compared to the previous period
- -8.5% — Red indicates decline compared to the previous period
- 0.0% — Grey indicates no change
Visitors & Pageviews Chart
The main chart displays daily traffic as a combined bar chart:
- Light bars (background) — Total pageviews for each day
- Dark bars (foreground) — Unique visitors for each day
Interactive Features
- Hover — Move your mouse over any bar to see a tooltip with the exact date, visitor count, and pageview count.
- Legend — The legend above the chart indicates which colour represents visitors vs. pageviews.
- Responsive — The chart automatically scales to fit different screen sizes.
Top Pages
The Top Pages panel shows the most visited pages on your site for the selected date range. Data is displayed in a table with visual progress bars:
| Column | Description |
|---|---|
| Page | The URL path of the page (e.g., /about/, /contact/). The background bar indicates relative traffic volume. |
| Visitors | Number of unique visitors who viewed this page. |
| Pageviews | Total number of times this page was loaded. |
Expandable Details
Pages with multiple URL variations (e.g., with different query parameters) show an expand arrow. Click the row to reveal:
- Individual URL variations with their specific visitor/pageview counts
- Query parameter tags (useful for tracking UTM campaigns, search queries, etc.)
Top Referrers
The Top Referrers panel shows where your traffic is coming from. Referrers are grouped by domain with their favicon displayed for easy identification:
| Column | Description |
|---|---|
| Referrer | The domain that referred traffic to your site (e.g., google.com, facebook.com). Includes a favicon from Google’s favicon service. |
| Visitors | Number of unique visitors from this referrer. |
| Pageviews | Total pageviews from visitors arriving via this referrer. |
Expandable Details
Click on a referrer row to expand and see the full referring URLs, including:
- Complete referrer paths (e.g., specific social media posts or forum threads)
- Query parameters that might indicate search terms or campaign tracking
Tech Breakdown
Three panels provide breakdowns of your visitors’ technology:
Devices
Shows the distribution of visitors by device type:
- 🖥 Desktop — Traditional computers and laptops
- 📱 Mobile — Smartphones
- ⬛ Tablet — Tablets and similar devices
Each device type shows the percentage of total traffic and the absolute visitor count.
Browsers
Lists the top browsers used by your visitors (e.g., Chrome, Firefox, Safari, Edge). Shows visitor count and pageviews for each browser.
Operating Systems
Lists the top operating systems (e.g., Windows, macOS, iOS, Android, Linux). Shows visitor count and pageviews for each OS.
Real-Time Visitors
The real-time indicator in the top-right of the toolbar shows how many unique visitors are currently active on your site:
- Pulsing dot — Indicates the real-time counter is active
- Visitor count — Number of unique visitors in the last 30 minutes
Tracking Methods
You can choose between two tracking methods, each with different trade-offs:
Server-side (PHP)
Recommended for most sites.
- Hooks into WordPress’s template loading process
- Tracks all page requests, including those from users with JavaScript disabled
- Cannot be blocked by ad-blockers or privacy extensions
- Faster execution (no additional HTTP request)
- May count some bots that mimic browser user-agents
Client-side (JavaScript)
- Uses the browser’s
sendBeacon()API to record pageviews - Only tracks real browsers that execute JavaScript
- Automatically excludes most bots (which don’t run JavaScript)
- Can be blocked by ad-blockers, privacy extensions, or disabled JavaScript
- Adds a small JavaScript snippet to your frontend
Data Retention
To manage database size, the Traffic Analytics module automatically deletes old data based on your retention setting:
- Default: 90 days
- Minimum: 30 days
- Maximum: 3650 days (10 years)
Data older than the retention period is permanently deleted during a weekly cleanup task. Consider your storage capacity and reporting needs when setting this value.
Recommendations
Use a Real System Cron
For accurate traffic aggregation, disable the built-in WordPress cron (DISABLE_WP_CRON) and configure a real system cron job instead. This ensures traffic data is processed reliably regardless of site traffic.
Add to wp-config.php:
define( 'DISABLE_WP_CRON', true );
Then set up a system cron to call wp-cron.php every minute:
* * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
Exclude Admin Traffic
Enable the “Exclude administrators” setting to prevent your own browsing from inflating traffic numbers. This is especially important during development or content editing sessions.
Choose the Right Tracking Method
- Use Server-side for maximum coverage and reliability
- Use Client-side if bot traffic is a significant concern and you’re comfortable with potential undercounting from ad-blockers
Troubleshooting
No data appearing on the dashboard
If the dashboard shows “No data available”:
- Verify the module is enabled in Settings → Traffic Analytics
- Check that data has had time to be collected (wait for at least a few pageviews)
- Ensure WordPress cron is running (visit your site or check cron status)
- If using JavaScript tracking, check that the script loads in your frontend (no ad-blocker interference)
Real-time count is always zero
The real-time count is updated during each aggregation cycle. If it stays at zero:
- Check that cron jobs are executing (the aggregation runs every minute)
- Verify you have recent visitors (excluded admins won’t show up if that setting is enabled)
- Wait 1–2 minutes for the next aggregation cycle to process
Traffic numbers seem too high (bot traffic)
If you suspect bots are inflating your numbers:
- Switch to Client-side (JavaScript) tracking, which excludes bots that don’t execute JavaScript
- The server-side tracking includes basic bot detection, but some sophisticated bots may still be counted
Traffic numbers seem too low
If numbers seem lower than expected:
- Check if you have the “Exclude administrators” option enabled (disable temporarily to test)
- If using JavaScript tracking, some visitors may have ad-blockers that prevent tracking
- Verify the date range includes the period you’re interested in
Warning about WordPress cron
The dashboard may display a warning recommending a real system cron. This appears when DISABLE_WP_CRON is not set. While the module works with WordPress’s built-in cron, a real system cron provides more reliable aggregation timing. See the Recommendations section.
Database growing too large
If database size is a concern:
- Reduce the data retention period in Settings
- The weekly cleanup task will remove data older than the retention period
- Consider the trade-off between historical data access and storage requirements
See
Traffic Analytics Module Developer Documentation for architectural details, class references, and code examples for extending the Traffic Analytics module programmatically.
Comments (0)
Join the conversation. to leave a comment.