Configuring the MXO Cordova SDK

The Medallia Experience Orchestration Cordova SDK performs merge updates when provided with JavaScript Configuration Objects with undefined configuration properties. However, if an undefined or null Configuration is provided, then the MXO configuration is cleared. When configured with invalid parameters, the SDK is set in an unconfigured state.

Note: When in an unconfigured state, the SDK queues user data locally and uploads that data to the server once the SDK is configured with valid parameters. Disable this functionality if necessary, at any time. For more information, see Opting a user out or into tracking.

The Medallia Experience Orchestration Cordova SDK supports User and Admin modes.

  • Admin mode — Admin mode provides you with an interface that lets you add Interaction Points, Activity Capture Points, and Attribute Capture Points to native UI elements within the app. However, hybrid apps do not support this feature because hybrid solutions typically use non-native UI elements. Only Preview mode is supported to view your unpublished (In the Works) configuration before publishing it to your live environment.

  • User mode — The User mode build should be made available through the App or Play Store, when you are satisfied that all insights are being tracked in Admin mode and internal QA requirements have been met.

Configure the Cordova SDK to activate your app to send Interactions in your app, by executing the following steps:
Note: Depending on which Cordova SDK mode you want to configure your app with, execute step 1 or 2 accordingly.
  1. Set up the SDK in User mode for App and Play Store builds.

    To start capturing, and receiving Optimizations with the Medallia Experience Orchestration Cordova SDK in User mode, you must first configure it with your Medallia Experience Orchestration API parameters. You can find your Orchestration API parameters on the API Credentials page.

    For more information on finding these parameters, see Integrating MXO with your mobile app.

    With your parameters ready at hand, add the following lines at the start of your app's lifecycle.

    const config = {
    	mode: 0,
    	touchpoint: 'cordova://appName',
    	host: 'https://eu2.thunderhead.com',
    	siteKey: 'ONE-XXXXXXXXXX-1022',
    	apiKey: 'f713d44a-8af0-4e79-ba7e-xxxxxxxxxxxxxxxxx',
    	sharedSecret: 'bb8bacb2-ffc2-4c52-aaf4-xxxxxxxxxxx',
    	userId: 'api@yourCompanyName'
    }
    MedalliaMXO.setConfiguration(config).then(() => {
    	// do something after the configuration has been set
    })
    .catch((error) => {
    	// do something with the error
    	console.error(error)
    })
    
  2. Set up the SDK in Admin mode for internal distribution.

    We recommend adding the Admin mode function on your internal builds, behind a debug settings function or on a dedicated build pipeline, as described in Admin mode.

    To use the framework in Admin mode, simply change the mode to 1, as follows:

    const config = {
    	mode: 1,
    	touchpoint: 'cordova://appName',
    	host: 'https://eu2.thunderhead.com',
    	siteKey: 'ONE-XXXXXXXXXX-1022',
    	apiKey: 'f713d44a-8af0-4e79-ba7e-xxxxxxxxxxxxxxxxx',
    	sharedSecret: 'bb8bacb2-ffc2-4c52-aaf4-xxxxxxxxxxx',
    	userId: 'api@yourCompanyName'
    }
    MedalliaMXO.setConfiguration(config).then(() => {
    	// do something after the configuration has been set
    })
    .catch((error) => {
    	// do something with the error
    	console.error(error)
    })

You have now configured the Medallia Experience Orchestration Cordova SDK for your app.