How It Works
Mouseflow generates a heatmap for every unique URL path affiliated with your website (e.g. www.website.com/pg1 and www.website.com/pg2 get their own heatmap). To combine the pages into one heatmap, a Mouseflow variable is used to create a new common path that both pages will use.
If you use query-string variables (e.g. www.website.com/pg1.php?pg_id=1) you can control whether they make your pages unique. But if they have different URL paths, two heatmaps will be generated.
// The path you specify must start with a '/'
var mouseflowPath = '/your/new/path';
The pages ‘/shop/products/product1’ and ‘/shop/products/product2’ (and all other product pages) should have one combined heatmap.
If you add the ‘mouseflowPath’ variable and set it to ‘ var mouseflowPath = ‘/shop/products/productdetail;’ on these pages, Mouseflow will treat all of these pages as one unique page and only generate one heatmap under the URL ‘/shop/products/productdetail’.
var _mfq = _mfq || ;
var mouseflowPath = '/shop/products/productdetail';
mf.src = "//cdn.mouseflow.com/projects/your-website-id.js";
- The mouseflowPath variable is only used by Mouseflow. It won’t affect the URL or title of your livepage in any way.
- If you use this technique you will no longer be able to see individual heatmaps for the pages you’ve combined
- You must add the ‘mouseflowPath’ variable to all of the pages you want to combine
- The mouseflowPath variable must be declared in the global scope.
Tags: combine heatmaps change path query string