Heatmaps
Most of the heatmap functions are controlled inside Monsido. However, to get it to work the Monsido script needs to be installed on the target website.
Basic setup
The basic requirement for the heatmaps to work is the presence of the Monsido 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
The heatmap function will automatically run on page load. It will calculate if the heatmaps should run on this session, based on how heatmaps have been configured for your Monsido account.
Heatmaps on SPA
If heatmaps are applied to an SPA (Single-Page Application), it is important to remember that, 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();
It is important to remember to restart the heatmap function after the URL has changed, using this command:
window.monsido_functions.resetHeatmap();