Heatmap & Navigation Clicks: Top Stats Panel
Heatmap & Navigation Clicks — Top Stats Panel
On the Click Map Details screen (page=wpmc-clicks-map-details),
the very first section you see is the top panel — a compact overview of the selected page with quick filters,
key metrics, and per-page cleaning actions.
Where to open: WPMC Behavior & Heatmap → Heatmap Page List → Details
Admin slug: wpmc-clicks-map-details
Main source: /extended/details.php
Top panel (overview): /extended/tabs/tab-overview.php
(+ logic in /extended/tabs/logic/)
What the top panel contains
The overview is a 3-column layout (left → middle → right). It is always visible above the heatmap iframe, and it updates when you change the date range.
Left column
- Date filter (From / To)
- Preset chips (quick ranges)
- Filter + Reset controls
Middle column
- Key metrics (Total Views, Unique Users, Avg. Time)
- Sparkline (daily views mini-chart)
- Search traffic blocks (Google/Bing/Yahoo)
Right column
- Per-page cleaning buttons (delete page data)
- AJAX endpoint protected by a nonce
- Removes clicks, views, and/or sessions for this URL
1) Date filter (From / To)
The top panel is always scoped to a date range. The filter is processed in
/extended/tabs/logic/date-filter-logic.php.
Defaults
- If no dates are selected, the overview defaults to the last 30 days for display.
- The SQL date condition is appended as:
AND timestamp BETWEEN %s AND %sfor views. - If the user swaps dates (To earlier than From), the code normalizes them.
Reset returns you to the base URL:
admin.php?page=wpmc-clicks-map-details&url=...
without date parameters.
2) Key metrics (how they are calculated)
The numeric cards in the middle column are computed in:
/extended/tabs/logic/overview-metrics.php
using the {prefix}wpmc_views table.
3) Sparkline (mini chart)
The sparkline visualizes daily page views inside the selected date range.
It is rendered as an inline SVG in tab-overview.php,
with data produced by a grouped SQL query (by date).
What it helps you see
- Sudden drops (traffic loss, tracking issues, broken campaign links)
- Spikes (campaign launches, social sharing, ads)
- Consistency (steady baseline traffic)
4) Search Engine Traffic blocks
Below the sparkline, the overview shows a small breakdown of external search traffic. The plugin currently checks three sources: Google, Bing, and Yahoo.
How it’s counted
- Only External referrers are included (
referrer_type = 'External'). - The referrer URL is checked with a
LIKEmatch:google.,bing.com,search.yahoo.com. - Results are sorted by count (highest first).
If there is no data, the card shows No data yet. This usually means your page has not received external search traffic in this range.
5) Per-page cleaning buttons (right column)
The right column contains three quick actions that remove tracking records for the current URL. These buttons call an admin AJAX endpoint and require a nonce for security.
Warning: Per-page cleaning is irreversible. Use it when you want to remove test clicks, rerun an experiment, or “start fresh” for a landing page.
How the page URL is matched (important detail)
The Details page normalizes the input URL for consistent database lookups:
- Host is lowercased
- Fragment is removed
- Tracking parameters can be removed for canonicalization (UTM, gclid, fbclid, and similar)
This normalization prevents duplicate rows for the same page caused by marketing parameters.
(Implementation: wpmc_normalize_url_basic() in /extended/details.php.)