Disabling automatic identity transfer

Disabling identity transfer

If the Medallia Orchestration Plugin is enabled, the SDK adds a tid as a URL query parameter to web links opened in Web View, Custom Tabs and external browsers (via Intent). To disable this functionality, call the mxoConfigureIdentityTransfer Kotlin top-level function or the MedalliaMXO.setIdentityTransferConfiguration Java method, as shown below:

import com.medallia.mxo.identitytransfer.MXOIdentityTransferConfiguration.Companion.copy
import com.medallia.mxo.mxoIdentityTransferConfiguration

// Disabling the identity transfer.
mxoIdentityTransferConfiguration = mxoIdentityTransferConfiguration.copy {
    	disableIdentityTransfer = true
}

// Updating the identity transfer configuration.
mxoIdentityTransferConfiguration = mxoIdentityTransferConfiguration.copy { 
	disableIdentityTransfer = false
}
import com.medallia.mxo.MedalliaMXO;
import com.medallia.mxo.identitytransfer.MXOIdentityTransferConfiguration;

// Disabling the identity transfer.
final MXOIdentityTransferConfiguration identityTransferConfiguration= new MXOIdentityTransferConfiguration.Builder()
        .disableIdentityTransfer(true)
        .build();
MedalliaMXO.setIdentityTransferConfiguration(identityTransferConfiguration);

// Updating the identity transfer configuration.
MXOIdentityTransferConfiguration currentConfiguration = MedalliaMXO.getIdentityTransferConfiguration();
MXOIdentityTransferConfiguration.Builder builder = currentConfiguration != null ?currentConfiguration.builder() : new MXOIdentityTransferConfiguration.Builder();
MXOIdentityTransferConfiguration updatedConfiguration = builder
	.disableIdentityTransfer(false)
	.build();
MedalliaMXO.setIdentityTransferConfiguration(updatedConfiguration);

This also disables the ability to automatically pick up parameters from deep links that open an app, while also preventing the SDK from adding the tid as a URL query parameter to web links opened from the app, resulting in the customer's identity not being transferred as they move across channels.

If you have disabled automatic identity transfer, you can still send all URL parameters received as part of a deep link by calling the java.net.URI.processDeepLink or android.net.Uri.processDeepLink Kotlin extension function or the MedalliaMXO.processDeepLink Java method, as shown below:

import com.medallia.mxo.process
import java.net.URI
import android.net.Uri

URI("myapp://MainActivity?customerKey=1").process()
Uri.parse("myapp://MainActivity?customerKey=1").process()
import com.medallia.mxo.MedalliaMXO;
import java.net.URI;

MedalliaMXO.process(URI.create("myapp://MainActivity?customerKey=1"));

This sends a PUT request to Medallia Experience Orchestration.

Creating a URL with the tid parameter to facilitate identity transfer

If you have disabled automatic identity transfer, you can still create a URL with a tid parameter to use in the app programmatically, by calling the java.net.URL.generateIdentityTransferUrl() Kotlin extension function or the MedalliaMXO.generateIdentityTransferUrl(URL) Java method, as shown below:

import com.medallia.mxo.generateIdentityTransferUrl
import java.net.URL

val urlWithTid = URL("http://mysite.com").generateIdentityTransferUrl()
import com.medallia.mxo.MedalliaMXO;
import java.net.URL;
import java.net.MalformedURLException;

try {
	URL url = new URL("http://mysite.com");
	URL urlWithTid = MedalliaMXO.generateIdentityTransferUrl(url);
} catch (MalformedURLException ex) {
	ex.printStackTrace();
}

Once you have the urlWithTid, pass this into the method which handles the opening of the URL.

Note: The above methods return null if the SDK is not configured or is in Admin Mode.

Creating an android.net.Uri or java.net.URI with the tid parameter to facilitate identity transfer

If you have disabled automatic identity transfer, you can still create an android.net.Uri or java.net.URI with a tid parameter to use in the app programmatically, by calling the java.net.URI.generateIdentityTransferUri() or android.net.Uri.generateIdentityTransferUri() Kotlin extension functions or the MedalliaMXO.generateIdentityTransferUri(Uri|URI) Java method as shown below:

import com.medallia.mxo.generateIdentityTransferUri
import com.medallia.mxo.generateIdentityTransferUrl
import java.net.URI
import java.net.URL

val urlWithTid = URL("http://mysite.com").generateIdentityTransferUrl()
val androidUriWithTid = Uri.parse("http://mysite.com").generateIdentityTransferUri()
val javaUriWithTid = URI("http://mysite.com").generateIdentityTransferUri()
import com.medallia.mxo.MedalliaMXO;
import android.net.Uri;
import java.net.URI;

Uri uri = Uri.parse("http://mysite.com");
Uri uriWithTid = MedalliaMXO.generateIdentityTransferUri(uri);
URI javaUri = URI.create("http://mysite.com");
URI javaUriWithTid = MedalliaMXO.generateIdentityTransferUri(javaUri);

Once you have the uriWithTid, pass this into the method which handles the opening of the Uri.

Note: The above methods return null if the SDK is not configured or is in Admin Mode.

Removing identity transfer support

To completely remove the identity transfer functionality for Android applied with the plugins DSL, make the following updates:

  1. Remove the Plugin from the plugins section of your top-level build.gradle.kts or build.gradle:

    plugins {
    	id("com.medallia.mxo-android-sdk-orchestration-gradle-plugin") version {PLUGIN_VERSION} apply false
    }
    plugins {
        	id 'com.medallia.mxo-android-sdk-orchestration-gradle-plugin' version {PLUGIN_VERSION} apply false
    }
  2. Remove the following from the plugins section of your app-level build.gradle.kts or build.gradle:

    plugins {
        	id("com.medallia.mxo-android-sdk-orchestration-gradle-plugin")
    }
    plugins {
        	id "com.medallia.mxo-android-sdk-orchestration-gradle-plugin"
    }
  3. Remove the maven repository from the repositories section of the pluginManagement section of your settings.gradle.kts or settings.gradle:

    maven {
          	name = "MedalliaMXO"
          	url = uri("https://repository.medallia.com/artifactory/mxo-android-sdk/")
    }
    maven {
    	name 'MedalliaMXO'
    	url 'https://repository.medallia.com/artifactory/mxo-android-sdk/'
    }

To completely remove the identity transfer functionality for Android applied via Legacy Plugin Application, make the following updates:

  1. Remove the Plugin from your app-level build.gradle.kts or build.gradle:

    apply (plugin = "com.medallia.mxo-android-sdk-orchestration-gradle-plugin")
    apply plugin: 'com.medallia.mxo-android-sdk-orchestration-gradle-plugin'
  2. Remove the maven repository from the repositories section of the buildscript section of your top-level build.gradle.kts or build.gradle:

    maven {
          	name = "MedalliaMXO"
          	url = uri("https://repository.medallia.com/artifactory/mxo-android-sdk/")
    }
    maven {
    	name 'MedalliaMXO'
    	url 'https://repository.medallia.com/artifactory/mxo-android-sdk/'
    }
  3. Remove the following from the dependencies section of the buildscript section of your top-level build.gradle.kts or build.gradle:

    classpath("com.medallia:mxo-android-sdk-gradle-plugins:{PLUGIN_VERSION}")
    classpath 'com.medallia:mxo-android-sdk-gradle-plugins:{PLUGIN_VERSION}'