Integrations
Leanplum is a mobile marketing platform providing cross-channel messaging and app optimization in a single solution. Leanplum offers Push, Email, Automation, App Editing, Personalization, A/B Testing, and Analytics.
Leanplum has limits around characters and the number of unique event names and attributes their platform can process as noted here: https://docs.leanplum.com/reference#api-limits, a non-compendious list can be found below. You should go to the link for a full list as it may be updated from time-to-time.
Events and user attributes must be under 140 characters and must follow the rules for following special characters:
transaction
and your event a transaction
)The mParticle Unity plugin also supports the Leanplum kit. Navigate to see Leanplum’s documentation for the steps needed for Unity support.
Use same settings for Production and Development
and specify the Production and Development Client Keys respectively.The mParticle SDK allows you to include the Leanplum kit which allows Leanplum interface components (images, layout files, etc.), and as a result, supports the entire Leanplum feature set, which includes:
mParticle publishes the Leanplum Kit as separate iOS and Android libraries which have a transitive dependency on the mParticle core libraries. You can add them to your app via Carthage, Cocoapods, or Gradle:
# Sample Podfile
source 'https://github.com/CocoaPods/Specs.git'
target '<Your Target>' do
pod 'mParticle-Leanplum'
end
// Sample build.gradle
dependencies {
// Ensure the Kit version matches that of the mParticle Core SDK that you're using
compile 'com.mparticle:android-leanplum-kit:4.16.4'
}
See the Apple SDK and Android SDK guides to read more about kits.
The kit will map events instrumented with the mParticle SDK onto Leanplum’s event methods. The source code to each kit is available if you would like to learn exactly how the above mappings occur:
If the Leanplum Kit it is included in your app, all event forwarding will be handled by the kit. No data from your mobile app will be forwarded server-to-server (S2S).
As long as the Leanplum Kit is included in your app, mParticle will pass any Push Notifications from Leanplum to the kit for display. However, you will need to provide credentials in the Leanplum dashboard.
See the main iOS and Android Push Notification documentation for more detail.
For Android push notifications you will need to provide your Server Key in your project Settings under Push Notifications. See the Leanplum documentation for more.
For iOS push notifications you will need to upload your APNs Push SSL certificate to Leanplum. See the Leanplum documentation for more information.
The mParticle S2S API allows you to send data server side (API reference). In this scenario, mParticle forwards data via Leanplum’s REST API which supports a limited set of features:
If you have included the Leanplum Kit in your app, no app data will be sent via the Server Integration.
If you are using the server side Leanplum integration:
By default, mParticle forwards web data to Leanplum client-side, by directly invoking Leanplum’s Javascript methods. Optionally, you can choose to forward web data server-to-server in the Connection Settings. Note that if you choose this option, your incoming data must have your selected User ID to be forwarded.
The following general parameters are forwarded to Leanplum:
Leanplum field | Description |
---|---|
appId | The value of App ID in the Configuration Settings. |
clientKey | The value of Client Key in the Configuration Settings. |
userId | The User ID selected in the Connection Settings. No data can be forwarded if the selected User ID is not present. |
deviceId | The Device ID setting controls what value is passed in the deviceId field per platform as follows: iOS - by default the IDFV will be used for Production and IDFA for Development or you can specify to always send IDFA or IDFV. Android - by default the Google Advertising ID will be used and then Android Device ID or you can specify to always send Google Advertising ID or Android ID. |
If available, mParticle will forward the email address as a user attribute with the key of "email" . |
The following default mappings exist when forwarding events from mParticle to Leanplum:
mParticle event/property | Leanplum action | Additional details |
---|---|---|
Application State Transition - Background | pauseSession | |
Application State Transition - Foreground | resumeSession | |
Custom Events | track | The event name is passed in the event argument and the event attributes are passed in the params argument. |
Push Registration | setDeviceAttributes | iOS - iosPushToken argument Android - gcmRegistrationId argument |
Session Start | start | The following additional parameters are forwarded to Leanplum: systemName , systemVersion , deviceName , deviceModel , locale , location , versionName , timezoneOffsetSeconds and country . |
Session End | stop | |
User Attributes | setUserAttributes | All user attributes are passed in the userAttributes argument. |
Setting Name | Data Type | Default Value | Description |
---|---|---|---|
App ID | string |
The application ID. To find it, select your app in the navigation column, and click Edit Apps. Under Keys, click Show. | |
Client Key | string |
Either the Production or Development keys, depending on which API call you want to make. |
Setting Name | Data Type | Default Value | Platform | Description |
---|---|---|---|---|
User ID | string |
customerId | All | Select which user identity to forward to Leanplum as your customer’s user ID. |
Android Device ID | string |
GAID | Android | Select which value to forward to Leanplum as the Device ID. |
Apple Device ID | string |
IDFV | iOS/tvOS | Select which value to forward to Leanplum as Device ID. Used for iOS and tvOS. Note that if the chosen deviceId is missing, the application falls back to the DAS. |
Roku Device ID | string |
RCID (Roku Channel Client ID) | Roku | Select which value to forward to Leanplum as Device ID. Note that if the chosen deviceId is missing, the application falls back to the DAS. |
Camel Case Property Names | bool |
true |
All | Apply camel casing to event and user attribute property names. |
Forward Web Requests Server Side | bool |
false |
Web | If enabled, mParticle will not initialize the full Leanplum integration on the web client. Instead, web data will be forwarded to Leanplum via server-to-server API. |
Was this page helpful?