Send your event data from RudderStack to Leanplum.
5 minute read
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
In your RudderStack dashboard, go to Directory > Destinations > Cloud Destinations and search for Leanplum.
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.
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.
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.
For iOS, Leanplum needs to be linked either as a dynamic or static framework with your application. You can do so by adding the following lines to your Podfile:
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:
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:
[[RudderClientsharedInstance]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:
[[RudderClientsharedInstance]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:
[[RudderClientsharedInstance]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.
This site uses cookies to improve your experience while you navigate through the website. Out of
these
cookies, the cookies that are categorized as necessary are stored on your browser as they are as
essential
for the working of basic functionalities of the website. We also use third-party cookies that
help
us
analyze and understand how you use this website. These cookies will be stored in your browser
only
with
your
consent. You also have the option to opt-out of these cookies. But opting out of some of these
cookies
may
have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This
category only includes cookies that ensures basic functionalities and security
features of the website. These cookies do not store any personal information.
This site uses cookies to improve your experience. If you want to
learn more about cookies and why we use them, visit our cookie
policy. We'll assume you're ok with this, but you can opt-out if you wish Cookie Settings.