---
title: "Heatmaps advanced instructions"
date: "2024-07-24T19:24:09+00:00"
summary: "Learn how to set up and manage heatmaps in Acquia Web Governance, including basic requirements and tips for single-page applications."
image:
type: "page"
url: "/web-governance/heatmaps-advanced-instructions"
id: "47599bae-96a6-451a-8442-75259d174ee4"
---

Most of the heatmap functions are controlled inside Web Governance. However, for heatmaps to work, the Web Governance script must be installed on the target website.
=====================================================================================================================================================================

Basic setup[​](https://developer.monsido.com/script/heatmaps#basic-setup "Direct link to Basic setup")
------------------------------------------------------------------------------------------------------

The basic requirements for heatmaps to work are the presence of the Web Governance token and the heatmap enabled attribute set to `true`.

### **Example**

    <script type="text/javascript">
        window._monsido = window._monsido || {
            token: "insert-your-monsido-token-here",
            heatmap: { 
                enabled: true 
            }
        };
    </script>
    <script type="text/javascript" async src="https://app-script.monsido.com/v2/monsido-script.js"></script>
    

How it works[​](https://developer.monsido.com/script/heatmaps#how-it-works "Direct link to How it works")
---------------------------------------------------------------------------------------------------------

The heatmap function will automatically run on page load. It will determine the heatmaps should run on a particular session based on how heatmaps have been configured for your Web Governance account.

Heatmaps on Single-Page Applications (SPA)[​](https://developer.monsido.com/script/heatmaps#heatmaps-on-spa "Direct link to Heatmaps on SPA")
---------------------------------------------------------------------------------------------------------------------------------------------

If heatmaps are applied to an SPA, by default, the heatmaps function runs on page load and sends its data when the page unloads.

It is possible to simulate an unload by using this command:

    window.monsido_functions.sendHeatmapData(); 
    

You must restart the heatmap function after the URL has changed, using this command:

    window.monsido_functions.resetHeatmap();