Capture Customer Keys

Typically, you would want to link a customers' profile to one or more keys either when they successfully log in to your app, or at another moment in time when an identifier is available.

To help you identify your customers you can send these keys to an interaction or as properties to a base Touchpoint using the SDK public methods.

In our use case example, we want to capture a customer's email address as a customer key when they log in to our mobile app.

Step 1: Create a "Login Successful" Interaction Point

In MXO create an Interaction Point to track successful logins to your app.

For more information, see Creating and Managing Interaction Points.

Example Details

FieldDescription
NameLogin Successful Interaction
Path/loginSuccessful

Mobile - CK Interaction Point

Step 2: Create a new "Email Address" Key Attribute

Create a new key attribute that will store the value captured for a customer's email address following a successful login.

For more information, see Creating and Managing Data Attributes.

Example Details

FieldDescription
NameEmail Address
DescriptionOptional
Customer Attribute TypeText
Key AttributeYes
API Nameemail_address
How should MXO store this value?As provided

Mobile - CK Key Attribute

Step 3: Create an Attribute Capture Point

Create a new URL /API Parameters Attribute Capture Point to capture a customer's email address when they log in to your app.

For more information, see Creating and Managing Data Attributes.

Example Details

FieldDescription
NameEmail Capture
URI/API Parameter to capture fromemailAddress
Store as:Existing Customer Attribute
Select Customer AttributeEmail Address (Text)

Mobile - CK CP 1

Mobile - CK CP 2

Step 4: Publish Your Changes

In MXO, publish your changes to push them to your live environment.

Important: You must have the Publish role in MXO to be able to be able to publish changes to your live environment. For more information, see Team Roles.

Step 5: Send Customer Keys to an Interaction

Use the Mobile SDK to send a customer's email address to MXO when they log in to your app successfully.

You can send the email address parameter using the public sendInteraction method.

This enables you to capture both the login activity and email address (to use as a key) for a customer, and allows you to recognize your app users.

Send Customer Keys using the iOS SDK

To send an Interaction request with properties using the iOS SDK, see the full instructions in the iOS SDK integration documentation.

Example

You can send the email address parameter when a user successfully logs in into your app using the SDK public method, as follows:

let myProperties = ["emailAddress":"user@email.com"] One.sendInteraction("/loginSuccessful", withProperties:myProperties) 

Send Customer Keys using the Android SDK

To send an Interaction request with properties using the Android SDK, see the full instructions in the Android SDK integration documentation.

Example

You can send the email address parameter when a user successfully logs in into your app using the SDK public method, as follows:

import com.thunderhead.mobile.interactions.OneInteractionPath import com.thunderhead.mobile.oneSendInteraction scope.launch { oneSendInteraction { interactionPath = OneInteractionPath(URI("/loginSuccessful")) properties = mapOf("emailAddress" to "user@email.com") } }