Leanplum

Send your event data from RudderStack to Leanplum.

Leanplum is a popular marketing and customer engagement platform. It boosts customer engagement and retention, leading to better conversion and increased business revenue.

Find the open source transformer code for this destination in the GitHub repository.

Setup

  1. In your RudderStack dashboard, go to Directory > Destinations > Cloud Destinations and search for Leanplum.
  2. Connect your source and click Continue.

Connection settings

Configure the following settings to set up Leanplum as a destination in RudderStack:

  • Name: Assign a name to uniquely identify the destination.
  • Application ID: Enter your Leanplum application ID.
  • Client Key: Enter the associated client key.
info

You can find your Application ID and Client Key by logging in to your Leanplum dashboard and navigating to Development - App Settings. Under Keys & Settings, click API Keys to get the required credentials.

For more information, see Leanplum documentation.

Connection mode

Destination info
  • Status: Generally Available
  • Supported sources: Android, iOS , Web, Unity, AMP , Cloud, Warehouse, React Native , Flutter, Cordova, Shopify
  • Refer to it as LEANPLUM in the Integrations object.

Connection modes
SourceCloud modeDevice modeHybrid mode
AMPsupportednot supportednot supported
Androidsupportedsupportedsupported
Cloudsupportednot supportednot supported
Cordovasupportednot supportednot supported
Fluttersupportedsupportedsupported
iOSsupportedsupportedsupported
React Nativesupportednot supportednot supported
Shopifysupportednot supportednot supported
Unitysupportednot supportednot supported
Warehousesupportednot supportednot supported
Websupportednot supportednot supported
Supported message types
SourceIdentifyPageTrackScreenGroupAlias
Cloud mode
Supported sourcessupportedsupportedsupportedsupportednot supportednot supported
Device mode
Androidsupportednot supportedsupportedsupportednot supportednot supported
Fluttersupportednot supportedsupportedsupportednot supportednot supported
iOSsupportednot supportedsupportedsupportednot supportednot supported

Send events in hybrid mode

You can use hybrid mode to send all events to Leanplum from your iOS and Android sources.

Use the hybrid mode option (highlighted below) while connecting your iOS/Android source to the Leanplum destination. Then, add the Leanplum integration to your project.

Leanplum hybrid mode connection setting

Why use hybrid mode

Certain Leanplum functionalities like push notifications and A/B testing require you to load the Leanplum SDK.

When you choose hybrid mode to send events to Leanplum, RudderStack:

  • Initializes the Leanplum SDK.
  • Sends all the user-generated events (identify, track, page, screen, and group) to Leanplum only through cloud mode and blocks them from being sent via device mode.
  • Sends the auto-generated events (A/B testing, push notifications that require the Leanplum SDK) via device mode.

With hybrid mode, you can send the auto-generated and user-generated events to Leanplum using a single connection.

Configuration settings

After completing the initial setup, configure the following settings to correctly receive your data in Leanplum:

  • Use in Development Environment: If this setting is enabled, make sure to provide the Client Key corresponding to your development environment. Failure to do so will result in a faulty SDK initialization and your events will fail.
  • Client-side event filtering: This setting lets you specify which events should be blocked or allowed to flow through to Leanplum. For more information, see Client-side Events Filtering.
  • Consent management settings: Configure the consent management settings for the specified source by choosing the Consent management provider from the dropdown and entering the relevant consent category IDs. See Consent Management in RudderStack for more information on this feature.

Add Leanplum integration to your project

Depending on your platform of integration, follow these steps below to add Leanplum to your project:

info

Note the following:

  • The RudderStack SDKs store the user traits from the identify call in SharedPreference and NSUserDefaults for Android and iOS respectively.
  • If RudderStack detects userId in the persisted traits information, it starts the native SDK along with it. If it is unable to find userId, RudderStack initializes the SDK without it. This is helpful in building a better session.
  • For a persisted userId, the code for Android is Leanplum.start(applicationContext, userId). If userId is absent, it is Leanplum.start(applicationContext). RudderStack follows a similar pattern for iOS as well.
  • While searching for the user identifier in the persisted traits, RudderStack looks for either userId or id.

Identify

RudderStack uses the identify call to populate and send user information to Leanplum.

Note that:

  • RudderStack uses the setUserId method of the Leanplum SDK to set the user’s identifier (userId).
  • It passes all the properties present in the event’s context.traits to the Leanplum SDK’s setUserAttributes method, which populates them in Leanplum.

The following snippet highlights a sample identify call:

[[RudderClient sharedInstance] identify:@"developer_user_id"
                                 traits:@{@"email": @"bar@foo.com"}];

Track

RudderStack forwards the track events to Leanplum without any modification to the payload, as long as the event name is not null.

The following snippet highlights a sample trackcall:

[[RudderClient sharedInstance] track:@"Accepted Terms of Service"
                          properties:@{
                                  @"foo": @"bar",
                              @"foo_int": @134
}];

Screen

Leanplum supports tracking the user states. RudderStack uses the screen calls to advance the user’s states to LeanPlum. For every screen event, RudderStack calls the advanceTo method of the Leanplum SDK along with the screen name and the associated event properties.

RudderStack also sends the automatically tracked screen events to LeanPlum.

The following snippet highlights a sample screen call:

[[RudderClient sharedInstance] screen:@"Main"];

Reset

You can use the reset method to clear the user identification in Leanplum. RudderStack calls clearUserContent method of the Leanplum SDK to clear the persisted user data.

The following snippet highlights a sample reset call:

[[RudderClient sharedInstance] reset];

Debugging

RudderStack sets the verbose logging for development mode for the Leanplum Native SDK, based on the logLevel set during the SDK initialization.

If the logLevel is set as DEBUG or more, RudderStack enables logging using the enableVerboseLoggingInDevelopmentMode method of the Leanplum SDK.


Questions? Contact us by email or on Slack