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.

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:

Customize tag option 1

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;

Customize tag option 2

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.