In some cases, a visitor to your website will refresh their browser.

When a visitor refreshes their browser, it will count as the same user, but as a new visit to that page in Mouseflow as well as other analytics tools and A/B testing tools.

You can pass a tag to Mouseflow to identify cases where the visitor has refreshed their browser.

The code below needs to be inserted into your Mouseflow tracking code just before the closing </script> tag:

if (window.performance) {
console.info("window.performance");
}
console.info(performance.navigation.type);
if (performance.navigation.type == performance.navigation.TYPE_RELOAD) {
window._mfq.push(["tag", "Page-Reloaded"]);
}

Once added to your tracking code, it should look like the example below:

<script type="text/javascript">
window._mfq = window._mfq || [];
(function() {
var mf = document.createElement("script");
mf.type = "text/javascript"; mf.defer = true;
mf.src = "//cdn.mouseflow.com/projects/your-website-id.js";
document.getElementsByTagName("head")[0].appendChild(mf);
})();
if (window.performance) {
console.info("window.performance");
}
console.info(performance.navigation.type);
if (performance.navigation.type == performance.navigation.TYPE_RELOAD) {
window._mfq.push(["tag", "Page-Reloaded"]);
}
</script>

Please note this code will push a Page-Reloaded tag for any event that triggers a page reload.

E.g., If you have a search bar on your page and the search triggers a page reload to display product on the same URL path, it will meet the criteria of a page reload.

It is not ideal to run this script on all pages on your website (in most cases), but rather one or more specific pages where visitors might be refreshing their browser for various reasons.

Please contact support@mouseflow.com with any questions.

Did this answer your question?