Knowledge base | mouseflow

Kissmetrics Integration

With Mouseflow, it's easy to push in data from third-party services to extend the native segmentation/filtering capabilities.

To integrate with KISSmetrics, we can hook into "km_ai" cookie to track users by the Kissmetrics Anonymous 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">

    var km_ai = Cookies.get('km_ai');

    // 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", "kissmetrics_id", km_ai]);

u can now filter the recording list by the kissmetrics_id variable -- pick kissmetrics_id as the key and enter a value for the ID, accordingly.