Cross-domain tracking allows Mouseflow to track a user's session across multiple domain names where you have Mouseflow is installed.

Normally, this is not needed. However, if you are tracking a user's journey across multiple domains for example from a hosted landing page or checkout flow, where the domain name of those pages is not your main domain then enabling cross-domain tracking is required.

How to enable Cross-domain Tracking

First, ensure both domains are added under the Domain for the project in your Settings.

Next, navigate to the Apps & Integrations section for your domain project.


Then, click the Cross-Domain Support app:

Then, enable the app:

Once configured, visitors going from the first domain to the second domain will have one combined recording session.

Important notes

  • This will only work for navigation in the same window/tab. If the visitor opens the second page in a new tab or window, two separate recordings will be generated.

  • This will only work for direct navigation from one domain to the other. So the Mouseflow tracking code needs to be on the last page of domain 1 and the first page of domain 2.

  • If you're using a tag manager, you'll want to deploy Mouseflow and any modifications to the Mouseflow code, via a custom HTML snippet/tag.

  • Enabling the Cross Domain Support integration will also change the URL's displayed in your recordings and heatmaps in Mouseflow to include the full domain name. If for example Mouseflow used to display your home page as just "/" it will now display the homepage as "www.yourdomain.com/".

Advanced:

If you want full control of the code or the display URL's then you can add the following string to your Mouseflow tracking code:

var mouseflowPath = window.location.hostname + window.location.pathname;

Note: It is required that the mouseflowPath is loaded before the rest of the tracking code, e.g.:

<script type = "text/javascript">
var mouseflowPath = window.location.hostname + window.location.pathname;
var mouseflowCrossDomainSupport = true;
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);
})();
</script>




Did this answer your question?