DOCUMENTATION

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_scripts when wpmc_bh_enabled is on or unset.
  • Use ?wpmc_bh=1 or ?wpmc_bh=on to force-enable during testing.
  • Use ?wpmc_bh=0 to force-disable during testing.
  • The wpmc_bh_tracker_enabled filter 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

Action Meaning
clickNormal click event, including CTA clicks.
navigationClick on a link that is expected to navigate.
beaconLifecycle or enrichment-style events supported by the schema and excluded from heat buckets by default.

Payload fields saved in the BH table

  • session_id, page_url, device, action, and ts.
  • x, y, vw, vh, and dpr.
  • label_hash, selector, nav_to_url, is_cta, and cta_type.
  • meta JSON 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-DD values and are expanded to full-day boundaries.