With some extra customization to the tracking snippet, Mouseflow gives you the ability to record only visitors who enter your site through a specific landing page or Entry Page.

Modify your Mouseflow Tracking Script

To ensure that you only record visitors coming from your chosen Entry Page you will have to replace your existing tracking code with something that follows this format:

Single entry page example

<script type="text/javascript">
window._mfq = window._mfq || [];
var mouseflowAutoStart = false;
var mfEntryPage= "/entry-page";

if (window.location.pathname.indexOf(mfEntryPage) === 0) {
document.cookie = "mf_record=1;path=/";
}

if (document.cookie.indexOf("mf_record=1") > -1) {
mouseflowAutoStart = true;
}

var mf = document.createElement("script");
mf.type = "text/javascript";
mf.defer = true;
mf.src = "//cdn.mouseflow.com/projects/{{website-id}}.js";
document.getElementsByTagName("head")[0].appendChild(mf);
</script>

Multiple entry pages example

<script type="text/javascript">
window._mfq = window._mfq || [];
var mouseflowAutoStart = false;
var mfEntryPages= ["/foo", "/bar/baz"];

for (var i = 0; i < mfEntryPages.length; i++) {
var mfEntryPage = mfEntryPages[i];
if (window.location.pathname.indexOf(mfEntryPage) === 0) {
document.cookie = "mf_record=1;path=/";
}
}

if (document.cookie.indexOf("mf_record=1") > -1) {
mouseflowAutoStart = true;
}

var mf = document.createElement("script");
mf.type = "text/javascript";
mf.defer = true;
mf.src = "//cdn.mouseflow.com/projects/{{website-id}}.js";
document.getElementsByTagName("head")[0].appendChild(mf);
</script>

Notes

  • You need to customize the path to the entry page by replacing /entry-page for the first example or /foo or /bar/baz in the second example.
  • Replace {{website-id}} with your unique website ID from Mouseflow on the "mf.src" line.
  • Test your code to make sure it has the desired functionality.

Once you've successfully updated your tracking code on all pages where you want the change to apply, please make sure to save your changes to the code.

When you've saved the changes you should begin seeing that all the recordings you get into Mouseflow will begin on the entry page you've chosen.

Did this answer your question?