Leanplum
Step-by-step guide to send event data from RudderStack to Leanplum.
Last updated
Was this helpful?
Step-by-step guide to send event data from RudderStack to Leanplum.
Last updated
Was this helpful?
Leanplum is a popular mobile marketing and customer engagement platform. It allows you to boost customer engagement and thereby drive retention, better conversion and increased business revenue.
RudderStack allows you to configure Leanplum as a destination and send your event data to it directly.
Find the open-source transformer code for this destination in our GitHub repo.
To enable sending data to Leanplum, you will first need to add it as a destination to the source from which you are sending your event data. Once the destination is enabled, events from our SDK will start flowing to Leanplum.
Before configuring your source and destination on the RudderStack, please verify if the source platform is supported by Leanplum, by referring to the table below:
Connection Mode
Web
Mobile
Server
Device mode
-
Supported
-
Cloud mode
-
-
-
To know more about the difference between Cloud mode and Device mode in RudderStack, read the RudderStack connection modes guide.
Once you have confirmed that the platform supports sending events to Leanplum, perform the steps below:
From your RudderStack dashboard, add the source. From the list of destinations, select Leanplum.
Give a name to the destination and click on Next. You should then see the following screen:
Leanplum Connection Settings in RudderStack
Enter the Leanplum Application ID as well as Client Key.
Click on Next to complete the configuration.
Leanplum should now be added and enabled as a destination in RudderStack.
If you choose to keep the Use in Development Environment flag as on, then please put your developmentKey
in the Client Key
field. Failing to do so will result to faulty initialization of the SDK and events will not be passed.
Depending on your platform of integration, follow these steps below to add Leanplum to your project:
Android iOS Please follow the steps below to add Leanplum to your Android Project:
Add the following repository
to your app/build.gradle
file.
After that, add the following dependencies
in the same file:
Finally, change the initialization of your RudderClient
in your Application
class.
Follow these steps to add Leanplum to your iOS project:
Go your Podfile
and add the Rudder-Leanplum
extension:
After adding the dependency followed by pod install
, you can add the imports to your AppDelegate.m
file as shown:
Finally, change the initialization of your RudderClient
as shown:
The RudderStack SDKs store the traits
information from the identify
call in SharedPreference
and NSUserDefaults
for Android and iOS respectively. If RudderStack detects the userId
in the persisted traits information, it starts the native SDK along with the userId
. On the other hand, if it can't find the userId
, it starts the SDK normally without it. This activity helps to build a better session.
The code for Android is the same as below:
Leanplum.start(applicationContext, userId)
for a persisted userId
and Leanplum.start(applicationContext)
if it is not present.
RudderStack follows a similar pattern for iOS as well.
While searching for userId
in the persisted traits, RudderStack looks for either of these fields: userId
and id
.
RudderStack sets the userId
of the user to the Leanplum SDK via the setUserId
method, and passes all the properties under context.traits
to the setUserAttributes
method, to get populated in Leanplum.
The following is an example of an identify
call:
Leanplum accepts any free-flowing property and event name. So, we forward the event as is to the Leanplum SDK without any modification to the payload, as long as the eventName
is not null
.
The following is an example of a track
call in RudderStack:
Leanplum supports tracking the user-states. We use the screen
calls to advance the states of the user to LeanPlum. For every screen
event we are calling the advanceTo
method of LeanPlum SDK along with the screen name and the properties
along with it.
We also send the automatically tracked screen
events to LeanPlum.
The following is an example of a screen
call in RudderStack:
RudderStack calls clearUserContent
method of the Leanplum SDK to clear the persisted data.
The following code snippet shows a sample reset
call:
RudderStack sets the verbose logging for development mode for the Leanplum Native SDK, based on the logLevel
of the RudderClient
. If the logLevel
is set as DEBUG
or more, RudderStack will turn on logging using the enableVerboseLoggingInDevelopmentMode
method of the Leanplum SDK.
You can find your Application ID and Client Key by logging on to your Leanplum account and navigating to More - App Settings . Then, click on the Keys & Settings button for the application you want to integrate with, and you should get the required credentials.
If you come across any issues while configuring Leanplum with RudderStack, please feel free to contact us. You can also start a conversation in our Slack community; we will be happy to talk to you!