CategoriesView All

Event

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.

Data Processing Notes

Leanplum has limits around characters and the number of unique event names and attributes their platform can process as noted here: https://www.leanplum.com/docs#/docs/api

  • Up to 200 distinct user attribute names per app.
  • Up to 500 event names per app.
  • Up to 50 user attributes per user.
  • Up to 50 event attributes per event.
  • Events and user attributes must be under 140 characters and must not start with a period or hyphen, end with a forward slash, contain commas, vertical pipes, double quotes, tabs, newlines, or return characters and must not be numeric.

Prerequisites

  1. In order to enable mParticle’s integration with Leanplum, you will need an account with Leanplum. Once logging into your Leanplum account, your App ID and Client Key can be found by clicking App Setting and then Keys and Settings.
    Leanplum Keys

  2. If you will be sending development data to Leanplum you will need to uncheck the Use same settings for Production and Development and specify the Production and Development Client Keys respectively.

mParticle Leanplum Implementation Scenarios

Kit Integration

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:

  • Push Notifications, including locally triggered push notifications
  • Newsfeed messages
  • In-App messages

Add the Kit to your app

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'

use_frameworks!

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' 
}

Reference 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.

Push Notifications

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.

Android

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.

iOS

For iOS push notifications you will need to upload your APNs Push SSL certificate to Leanplum. See the Leanplum documentation for more.

Server Integration

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:

  • Updating User information - device and user attributes
  • Event tracking

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:

  • Contact your Leanplum account manager to ensure that your Leanplum account is provisioned for Full Service.
  • For data from the Android or iOS platforms, mParticle will only forward events to Leanplum if a Device ID is available.
  • For data from a feed, mParticle will only forward events to Leanplum if a User ID is present. User ID can be set to Customer ID or email, in the Connection Settings.

General Parameters

The following general parameters are forwarded to Leanplum:

Description mParticle details Leanplum field
Application ID The value of setting App ID appId
Client Key The value of setting Client Key clientKey
The current user ID The value of setting User ID. If an email or Customer ID is not available, this field is not forwarded. userId
A unique ID for the device making the call 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.
deviceId

Event Data Mapping

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.

Configuration Settings

Setting Name Data Type Default Value Description
App ID string Your Leanplum’s App ID.
Client Key string Your Leanplum’s Client Key, which is named either Production or Development under Keys & Settings in the Dashboard.

Connection Settings

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 gaidThenAndroidId Android Select which value to forward to Leanplum as Device ID. The default is to use Google Advertising identifier and if not available Android ID, but can be modified to always use Google Advertising ID or the Android ID.
IOS Device ID string idfvForProdAndIdfaForDev iOS Select which value to forward to Leanplum as Device ID. The default is to use IDFV in Production and the IDFA in Development, but can be modified to always use IDFV or IDFA for both environments.
Camel Case Property Names bool true All Apply camel casing to event and user attribute property names.