As the ROI code that identifies the recipient and their emails is stored in the browser LocalStorage, it affects the ability to track across multiple domains.
If your site uses multiple domains, then you may need to implement cross-domain tracking on top of the standard setup.
Not needed for intermediate payment pages
Cross-domain tracking is not normally needed if the only other domain in your checkout process is a payment provider. If your completion page (and therefore the call to mark the transaction complete) is on your own site, then it does not matter that the intervening payment pages are off-site.
Cross-domain tracking can be handled automatically, but there are also a number of methods available for you to manually implement a solution.
Automatic
When enabled, the ROI script will automatically add the required query string parameters to URLs linking to a configuredĀ autoLink
Ā domain, and also to any forms whose action is on a configuredĀ autoLink
Ā domain.
First, make sure that the standard setupĀ has been implemented for all required domains.
Once this is done, set your domains and enableĀ autoLink
Ā in the config for the ROI Tracking script using theĀ setAutoLinkDomainsĀ andĀ setAutoLinkĀ methods:
<script type="text/javascript">
// ROI config options go here
// Enable cross-domain tracking
Mxm.Tracker.setAutoLinkDomains([
'www.mydomain.com',
'secure.mydomain.com',
'www.mydomain.co.uk'
]);
Mxm.Tracker.setAutoLink(true);
</script>
Manual (Advanced)
If you do not want to use the automatic addition of the ROI query string parameters to all links to a given domain, it's possible to formulate your own solution with the aid of some additional methods.
After completing a standard setup on all required domains, define the link domains usingĀ setAutoLinkDomains.
You can then pass individual links and forms usingĀ addLinkĀ andĀ addFormĀ for the script to monitor.
Alternatively, you can add the necessary ROI query string parameters to your own URLs. The query string key and value are available fromĀ getQueryKeyĀ andĀ getRoiCodeĀ respectively.