ROI Tracking

ROI Tracking enables Maxemail to track conversions and revenue from your email campaigns.

Optionally, it also allows gathering full website page visit data for each recipient that clicks through from an email campaign. There is no direct usage for this data in Maxemail however, so we recommend alternative tools like Google Analytics to monitor user visits on your site.

How it works

When enabled by ticking Track ROI in an email's Setup page, Maxemail will add a special query string to every link in the email, which looks similar to: mxmroi=1-1-1-0

When a recipient clicks on a link, this information is passed in the URL to your website, where the ROI Tracking script must be deployed. The tracking script picks up the information from the URL so it can identify the email recipient, and then tracks them on your website until they complete a transaction. The completion and optionally the revenue is sent back to Maxemail so it can be recorded in the email stats.

By default, the ROI code that identifies the recipient is stored in the browser's LocalStorage for 45 days. If the recipient returns to the site within this time, any transaction will be recorded against the email which they originally clicked. To adjust the lifetime of this identification, see setExpiryDays.

📘

Update v141, February 2024

Prior to v141, Maxemail stored the recipient's anonymised details in a cookie, for the purposes of being able to maintain their identity from the landing page to checkout.

As soon as a recipient visits a website that is connected to Maxemail v141, any details already stored in the cookie are automatically migrated to LocalStorage without any action from the end-user, or website developer. The cookie is then deleted. This behaviour is the same for anyone who still has cookie details within the expiry period by clicking on a previous email, or any recipient clicking thorugh from an email after the release of v141.

Regardless of the update, the cookie will still expire after the correct number of days as previously configured.

Previous cookie details:

Cookie namemxmroi
Cookie valueeg. 1-1-1-0
Cookie lifetimedefault 45 days (change with setExpiryDays)

Identifier details

These details may be required for your own website privacy or cookie policy:

LocalStorage keyLocalStorage valueExpected expiry
mxmroiHyphen-separated integers, used to identify the Maxemail customer, email campaign, and recipient. eg. 1-1-1-0Default 45 days (change with setExpiryDays)
mxmroi_expiryUnix timestamp integer, eg. 1707127200Default 45 days (change with setExpiryDays)

Tracking Domain Restriction

Because Maxemail has to modify the link URLs to include the ROI query string, it should be configured to only do this for your own website. This prevents Maxemail from modifying the URL of any other websites which may be linked, eg. third-party sites. A user with administration rights can modify the Tracking Domains configuration of a customer space. If you do not have access to the Admin window, please contact the Support Team.

Standard Setup

There are three parts to a successful implementation:

1. Track the recipient

The first step is to add the ROI Tracking script to your website. This will make the ROI Methods available for you to use (so must be loaded on the page before trying to call any of the methods) but it will only execute once the page load is complete.

We recommend simply adding the following to your website's main template so it is applied to every page. Usually this would be added in the HEAD section of your HTML document.

<script src="https://mxm.xtremepush.com/scripts/tracker.js"></script>
 
<script>
// ROI config options go here
</script>

Any ROI config options must be included immediately, before the page load is complete. These are marked in ROI Methods.

2. Set the revenue

👍

For revenue only

This section can be skipped for websites that do not have a revenue to track, eg. restaurant reservation sites.

Maxemail will display various revenue statistics for an email for completed transactions. It's also possible to export the data for incomplete transactions separately.

In order to display the revenue for completed transactions, the revenue must be defined before the transaction is marked as complete.

If tracking incomplete baskets is required, then the revenue should be set whenever it's available on your site (eg. when a shopping basket total is available/updated). The system will update the revenue value stored against that particular recipient for the current transaction, so that if the transaction is never marked as complete, the system will have the most up-to-date revenue value available for the incomplete transactions report.

The revenue should be set using either setRevenue or setRevenueEl. This must then be followed by a call to track or complete (unless autoTrack is enabled and the revenue has been defined before page load is complete).

Example

<script>Mxm.Tracker.setRevenue(20000);</script>

📘

Integer only

Revenue must be tracked as an integer (whole number). No currency symbols or decimal points are allowed.
For example, £200.00 is tracked as 20000.

3. Mark the transaction complete

In order to show conversion stats against the email, the system should be instructed that the current transaction is complete. Use the complete method on your completion page.

👍

Reference recommended

In order to record more than one transaction per recipient for a given email, it is necessary to provide a unique transaction reference. Without this any subsequent transactions will not count towards the email stats.

The example below shows how the revenue and completion can be set in one request on the completion page:

<script>Mxm.Tracker.setRevenue(20000).complete('ORD123');</script>