Knowledge base | mouseflow

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.

This integration example uses the js-cookie library. Add it to your site by adding this line:

<script src=""></script>


<script type="text/javascript">

    // 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", Cookies.get('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.