Enable the JavaScript Methods

The MXO JavaScript methods are exposed through the customerAPI object. To use these methods, customize the MXO Tag code in the main MXO UI.

Option 1 (Recommended)

Attach a set of functions to the existing defaults object that simplify how your page logic interfaces with the customerApi object.

Example

Add a function to send a login event to MXO, as follows:

MXO Tag - Customize Option 2

Option 2

Expose the methods to your page JavaScript, by setting the customerAPI object as a global variable.

Example

Create a new global variable, oneCustomerApi, from the customerAPI object, as follows:

window.oneCustomerAPI = customerAPI;

MXO Tag - Customize

Trigger the methods from your page JavaScript, using, for example, window.oneCustomerApi.sendInteraction() or window.oneCustomerApi.sendProperties() as required.

All triggered events are associated with the current, identified, customer, based on their TID.