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

Specify how you want to route events from your source to Leanplum.

RudderStack supports sending events to Leanplum via the following connection modes:

Connection modeWebMobileServer
Device mode-Supported-
Cloud modeSupportedSupportedSupported
Hybrid mode-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.
  • OneTrust cookie consent settings: This setting lets you associate the OneTrust cookie consent groups to Leanplum.

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