Mouseflow Help & Support

Cross Domain Tracking

Follow

With Mouseflow, it's easy to track visitors that travel across several domains. The normal installation procedure tracks each of these domains separately. But in some cases, it's better to have a combined recording for a cross domain visit. This is especially useful when hosting a landing page or checkout flow on a different domain from your main site.

The first step is to make sure both domains are added under "Domain" for the project in question. You can check this by picking the website you're interested, and clicking the "Settings" tab on the left hand side. Now check that both domains are listed in the "Domains" field. This will allow you to track both domains, and will generate two recordings - one for each domain. To combine these recordings, you'll need to alter the tracking code for each domain.

Change:

You'll need to add this line to the start of the tracking code:

var mouseflowCrossDomainSupport = true;


Full example:

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


Once this is set up, visitors going from the first domain to the second should 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 different recordings will be generated
  • In the code example, you should replace the 'your-website-id' with your Website ID, which can be found under Settings.
  • 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.

 

Tags: cross domain tracking track multiple domains

Have more questions? Submit a request

Comments

Powered by Zendesk