HeatmapSessionRecording configures itself during tracker through a special configs.php endpoint. The endpoint accesses entities for the site and provides it to the tracker. This type of endpoint should be standardized so any plugin can send data to the tracker before tracking.
One possible implementation would be:
Some things to consider:
few edge cases but can workaround it like
• user doesn't send a tracking request on that page ... then if we haven't send a tracking request eg 1s after on-ready then we would maybe need to issue a request to get this info
• it takes ages for the readyEvent to be triggered in the browser which then triggers the pageview which we then need to wait for the response and it might mean we're getting some information too late and by then the user moved already to the next page (that be fine though likely since it would mean user did likely not take any action)