Disable heatmap when using Tag Manager

I am a beginner with Matomo.
On our site, we use the Tag Manager script to manage activity tracking:

<!-- Matomo Tag Manager -->
  var _mtm = window._mtm = window._mtm || [];
  _mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
  (function() {
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
    g.async=true; g.src='https://cdn.matomo.cloud/.../container_....js'; s.parentNode.insertBefore(g,s);
<!-- End Matomo Tag Manager -->

We’ve been asked to disable heatmaps (for CNIL Compliance) using this instruction:


But it would appear that this instruction is specific to Matomo’s JS tracker, and not the Matomo Tag Manager.

If this is the case, how do you disable heatmaps from the Tag Manager? Does this require a developer action?

Hi @Bilaal_Y
You can totally disable the heatmap / session recording from Matomo UI if you want.

If you want to disable it only in some cases through MTM, you should trigger a first JavaScript tag containing the _paq.push(['HeatmapSessionRecording::disable']); script…

Hello @heurteph-ei

Thank you for your reply ! It solved my issue perfectly.

1 Like