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
Field | Description |
---|---|
Name | Login Successful Interaction |
Path | /loginSuccessful |
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
Field | Description |
---|---|
Name | Email Address |
Description | Optional |
Customer Attribute Type | Text |
Key Attribute | Yes |
API Name | email_address |
How should MXO store this value? | As provided |
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
Field | Description |
---|---|
Name | Email Capture |
URI/API Parameter to capture from | emailAddress |
Store as: | Existing Customer Attribute |
Select Customer Attribute | Email Address (Text) |
Step 4: Publish Your Changes
In MXO, publish your changes to push them to your live environment.
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") } }