Heatmaps in Matomo are a powerful feature that allows you to visually analyze user interactions and behaviors on your website. Heatmaps provide valuable insights by displaying aggregated data in the form of color-coded visualizations, making it easier to understand user engagement patterns.
To enable heatmaps in Matomo, you need to meet the following requirements.
Accessible configs.php file:
Matomo relies on the configs.php file to store configuration settings. Ensure that this file is accessible and not blocked by any server-side restrictions or security measures. If the configs.php file is blocked, heatmaps and session recording may not work as expected.
User Consent and Privacy:
Ensure that you comply with applicable data privacy regulations and obtain user consent if required before enabling heatmaps on your website. Respecting user privacy is crucial when using tracking tools like Matomo. The Matomo developer hub has instructions on how to mask private data in your recordings.
Working with iframes
Heatmaps with iframes can be a bit tricky, since the concept of an iframe is to not expose any of its internal HTML to the parent page to keep things secure. In general there are some options:
Add the tracking code to the iFrame itself – In some cases if you have access to the iframed page, you can try adding the tracking code to the iframed page. If doing this, it is important to first check the following faq – https://matomo.org/faq/how-to/how-do-i-track-a-website-within-an-iframe
Load the page content from the iFrame differently – An example would be using jQuery to get the content of the page and then insert specific page elements into the page they need to be displayed on.
If heatmaps are not working as expected, please consider the following troubleshooting steps.