Capturing Profile Data

The Salesforce CDP Module for the Engagement Mobile SDK enables collection of profile data through the SDK’s Identity APIs.
Before profile data can be sent to Salesforce CDP:
  1. The Salesforce CDP Module for the Engagement Mobile SDK must be configured and initialized.
  2. Consent to track must be granted.

Setting Profile Attributes

iOS
1import Cdp
2import SFMCSDK
3
4...
5
6let profileAttributes = [
7  "email": "user@domain.com",
8  "username": "user01"
9]
10SFMCSdk.identity.setProfileAttributes([.cdp: profileAttributes])
Android
1import com.salesforce.marketingcloud.sfmcsdk.SFMCSdk
2import com.salesforce.marketingcloud.sfmcsdk.modules.ModuleIdentifier.CDP
3
4...
5
6val profileAttributes = mapOf(
7  "email" to "user@domain.com",
8  "username": "user01"
9)
10SFMCSdk.requestSdk { sdk ->
11  sdk.identity.setProfileAttributes(profileAttributes, CDP)
12}

When a profile attribute changes, the Salesforce CDP Module triggers an identity profile event containing all the attributes that have been set. These attributes can be set to any name and value pair.

Supported Customer 360 Data Model Models

The Identity Schema provided by the recommended Mobile Connector schema for Salesforce CDP contains profile attributes that support identity resolution features in Salesforce CDP when mapped to the appropriate Customer 360 Data Models.

Each identity event contains fields that can be mapped.
  • Individual
    • firstName
    • lastName
  • Software Application
    • softwareApplicationId
    • softwareApplicationName
  • Device
    • advertiserId
    • deviceType
    • osName
  • Contact Point App
    • softwareApplicationId
Contact Points
Each supported contact point has a set of required attributes that must be provided to the SDK’s Identity API. After all attributes have been provided, the Salesforce CDP Module triggers a profile event contacting points, along with an identity event. The contact points and required attributes that trigger them are:
  • Contact Point Email Schema
    • email
  • Contact Point Phone Schema
    • phoneNumber
  • Contact Point Address Schema
    • addressLine1
    • city
    • postalCode
    • stateProvince
    • country

Anonymous and Known Users

The Salesforce CDP Module considers all customers as known unless they’ve been explicitly identified as anonymous by setting the profile attribute isAnonymous=1. Conversely, setting isAnonymous=0 ensures the customers are considered known.

iOS
1import Cdp
2import SFMCSDK
3
4...
5
6// treat a profile as anonymous
7SFMCSdk.identity.setProfileAttributes([.cdp: ["isAnonymous": 1]])
8// or use this convenience function
9CdpModule.shared.setProfileToAnonymous()
10
11// treat a profile as known
12SFMCSdk.identity.setProfileAttributes([.cdp: ["isAnonymous": 0]])
13 // or use this convenience function
14 CdpModule.shared.setProfileToKnown()
Android
1// treat a profile as anonymous
2SFMCSdk.requestSdk { sdk ->
3  sdk.identity.setProfileAttribute("isAnonymous", 1, CDP) 
4}
5
6// treat a profile as known
7SFMCSdk.requestSdk { sdk ->
8  sdk.identity.setProfileAttribute("isAnonymous", 0, CDP) 
9}

Shared Party Identifiers

The Engagement Mobile SDK also supports sharing identifiers between modules that support other Salesforce systems for integration use cases. For example, match an individual using a mobile application that is instrumented with both Salesforce CDP and the Marketing Cloud MobilePush modules in order to send a push notification to a specific anonymous mobile user.

Anonymous MobilePush User
The identity event contains fields that can be mapped to the Party Identification model:
  • registrationId → Identification Number
Known MobilePush User
When the Marketing Cloud MobilePush module obtains a resolved identity for a mobile customer it sets a profileId using the SDK’s Identity API. The Salesforce CDP module is notified of this change and sends a partyIdentification event with the following fields:
  • userId → Identification Number
  • IDName → Party Identification Name
  • IDType → Party Identification Type