Documentation
BH Heatmap Engine
BH Heatmap Engine
The BH engine lives in heatclick-BH. It records click events through build/tracker.js,
stores them in wpmc_bh_clicks, and exposes REST/AJAX endpoints for ingest and admin visualization.
Frontend loading
- The tracker is enqueued on
wp_enqueue_scriptswhenwpmc_bh_enabledis on or unset. - Use
?wpmc_bh=1or?wpmc_bh=onto force-enable during testing. - Use
?wpmc_bh=0to force-disable during testing. - The
wpmc_bh_tracker_enabledfilter can override the final enabled state. - The script tag is converted to
type="module". - File modification times are used as cache-busting versions when files exist.
Event types
Payload fields saved in the BH table
session_id,page_url,device,action, andts.x,y,vw,vh, anddpr.label_hash,selector,nav_to_url,is_cta, andcta_type.metaJSON containing scroll position, document dimensions, text under click, fixed/sticky element data, and other context.
Admin data queries
wpmc_bh_query_aggregated()groups click coordinates into heatmap buckets and excludes beacon events.wpmc_bh_query_elements()groups events by label hash and selector.wpmc_bh_query_navigation()groups navigation events by destination URL.wpmc_bh_query_points()returns raw points for rendering and excludes beacons by default.- Date filters accept
YYYY-MM-DDvalues and are expanded to full-day boundaries.
