Mouseflow Help & Support

Hubspot Integration


With Mouseflow, it's easy to control whether you track certain visits by altering how the tracking code is executed.

To integrate with Hubspot, we can hook into the "hubspotutk" cookie to track users by the Hubspot ID in Mouseflow. This integration makes use of our Custom Variables feature. Just replace your tracking code with the snippet below.


<script type="text/javascript">

function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i=0; i<ca.length; i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1);
if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
return "";

// Mouseflow tracking code
window._mfq = window._mfq || [];
 (function() {
    var mf = document.createElement("script"); mf.type = "text/javascript"; mf.async = true;
    mf.src = "//";

_mfq.push(["setVariable", "hubspot_id", getCookie('hubspotutk')]);


You can now filter the recording list by the "hubspot_id" variable. Pick "hubspot_id" as the key and enter a value for the ID, accordingly.


Tags: integrate hubspot third party service custom variables

Have more questions? Submit a request


Powered by Zendesk