Mouseflow gives you complete control over what visitors get recorded. For example, you can choose to only record visitors who perform a specific action - like logging in, adding an item to the cart, or simply clicking a button.


To only track visits from specific visitors, we can include a check for the Entry Page in the Mouseflow Tracking Code.

Modify your Mouseflow Tracking Script

  1. Prevent recording by adding var mouseflowAutoStart = false to the top of your tracking snippet just after the opening <script> tag.

  2. Next, use JavaScript to assign either true or false to the shouldRecord variable. In this example, we will record all visitors who visit a the page /page-to-record.


<script type="text/javascript">
var mouseflowAutoStart = false;

var shouldRecord = window.location.pathname === "/page-to-record";

if (shouldRecord) {
localStorage.setItem('mf_record_user', '1');

if (localStorage.getItem('mf_record_user')) {
mouseflowAutoStart = true;

window._mfq = window._mfq || [];
(function() {
var mf = document.createElement("script");
mf.type = "text/javascript"; mf.defer = true;
mf.src = "//<WEBSITE_ID>.js";

Make sure to replace <WEBSITE_ID> with your website ID. This can be found in your website settings.

Did this answer your question?