CleverTap
Step-by-step guide to send your event data from RudderStack to CleverTap.
Last updated
Was this helpful?
Step-by-step guide to send your event data from RudderStack to CleverTap.
Last updated
Was this helpful?
CleverTap is a popular customer engagement and retention platform. Its in-app analytics and marketing capabilities allow you to get real-time insights into your customers and build valuable, long-term relationships with them. With CleverTap, you can easily your users' actions and understand how they are using your product. You can also segment users based on their behavior and run targeted campaigns to boost your user engagement and retention metrics.
You can now send your event data directly to CleverTap through RudderStack.
Find the open-source transformer code for this destination in our GitHub repo.
Before configuring your source and destination on the RudderStack, please check whether the platform you are sending the events from is supported by CleverTap. Please refer the following table to do so:
Connection Mode
Web
Mobile
Server
Device mode
Supported
Supported
-
Cloud mode
Supported
Supported
Supported
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 CleverTap, perform the steps below:
From your RudderStack dashboard, add the source and CleverTap as a destination.
To successfully configure CleverTap as a destination, you will need to configure the following settings:
Account ID: Your account ID is an unique ID generated for your account. It can be found in your account in the Settings as your Project ID.
Passcode: Your account passcode is an unique code generated for your account. It can be found in the Settings as Passcode.
Enable track for anonymous user: Enable this option to track anonymous users in CleverTap.
Use Clevertap ObjectId for Mapping: Enable this option to use both CleverTap objectId
along with identity
for mapping events from RudderStack to CleverTap.
Region: Server Only: This is your dedicated CleverTap region.
Use Native SDK to send Events: Enable this option if you want to send events using device mode.
All server-side destination requests require either a anonymousId
or a userId
in the payload.
Android iOS React Native To add CleverTap to your Android project and enable functionalities like push notifications, follow these steps :
Open your project level build.gradle
file, and add the following:
Ensure that android.useAndroidX
is set to true
in your gradle.properties
file.
Also, add the following under the dependencies
section:
Initialize the RudderStack SDK in the Application
class's onCreate()
method as shown:
Follow these steps to add CleverTap to your iOS project:
Go your Podfile
and add the Rudder-CleverTap
extension as shown below:
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:
To add CleverTap to your React Native project:
Add the RudderStack-CleverTap module to your app using :
Run pod install
inside the ios
directory of your project adding @rudderstack/rudder-integration-clevertap-react-native
to your project.
Import the module you added above and add it to your SDK initialization code as shown below:
The steps to configure push notifications for CleverTap for the platform of your choice are as mentioned below:
Android iOS React Native
Register push notifications for Android devices on your CleverTap dashboard either by uploading your FCM credentials or any other supported credentials by navigating to Settings - Channels - Mobile Push - Android.
Add the following dependency in your project level build.gradle
file inside the buildscript
:
Next, add the following dependencies and plugin to your app level build.gradle
file:
Place the google-services.json
downloaded from the Firebase console
into the root folder of your app
.
Add your CLEVERTAP_ACCOUNT_ID
, CLEVERTAP_TOKEN
& FcmMessageListenerService
to the application
tag of your app's AndroidManifest.xml
, as below:
Finally, create a notification channel anywhere in your application using the following block of code. You can then use this channel Id
while creating any campaign on your CleverTap Dashboard.
For the Push Notification and In-App messages function correctly, CleverTap needs to know the Application
status as early as possible. You can either set the android:name
in your AndroidManifest.xml
tag to com.clevertap.android.sdk.Application
. Or, if you have a custom Application class, call ActivityLifecycleCallback.register(this);
before super.onCreate()
in your Application class.
To know more on this you can check the CleverTap documentation on push notifications.
Add Push Notification as a capability by navigating to Target - Signing & Capabilities
of your app when opened in Xcode.
Enable Background Modes/Remote notifications
by navigating to Targets -> Your App -> Capabilities -> Background Modes and then check Remote notifications
Register the push notifications for the iOS devices on your CleverTap dashboard either by uploading Auth Key or APNS Push Certificate by navigating to Settings -> Channels -> Mobile Push -> iOS.
Then, add the following code in your app just after initializing RudderStack's iOS SDK to register the push notifications.
Finally, add the below handlers to handle the tokens and push notifications accordingly:
Open android
folder of your React Native app and do follow all the steps mentioned in Android
tab of Configuring Push Notifications
Open ios
folder of your React Native app and do follow all the steps mentioned in iOS
tab of Configuring Push Notifications
CleverTap uniquely identifies each user with two main identifiers, namely objectId
and identity
. When the Use Clevertap ObjectId for Mapping option is enabled in the dashboard, both objectId
and identity
are used for mapping.
When the Use Clevertap ObjectId for Mapping setting is disabled in the dashboard, RudderStack expects the the following mapping for identifying users and tracking events (track
/page
/screen
):
RudderStack
CleverTap
userId
or anonymousId
identity
When the Use Clevertap ObjectId for Mapping setting is enabled in the dashboard, the following mapping is expected:
For identify
events:
RudderStack
RudderStack
CleverTap
CleverTap
anonymousId
present?
userId
present?
objectId
identity
Yes
Yes
anonymousId
userId
Yes
No
anonymousId
-
No
Yes
CleverTap-generated UUID
userId
For track
events:
RudderStack
RudderStack
CleverTap
CleverTap
anonymousId
present?
userId
present?
Tracking with
Value
Yes
Yes
objectId
anonymousId
Yes
No
objectId
anonymousId
No
Yes
identity
userId
When you track an unidentified user in CleverTap, a user profile is created with minimal details, along with the details of the user's activity. When the same user is then identified with a userId
without the Use CleverTap ObjectId for Mapping option enabled, RudderStack creates another profile for the user with the identifier userId
(in case of RudderStack) which maps to identity
(in case of CleverTap).
One way to solve this problem is to track users only in cases where a userId
is present. To do so, you can disable the Enable tracking for anonymous users option in the RudderStack dashboard. Alternatively, you can enable the Use Clevertap ObjectId for Mapping option in the dashboard which allows you to track the anonymous users and when they are later identified, merge their anonymousId
with their userId
.
This section is applicable for the Android and iOS sources when sending events via the Cloud Mode.
When the device token is present in context.device.token
in identify
calls, RudderStack will use the CleverTap Device Token Upload API to upload the device token for the identified user. For Android, RudderStack sets the token type as fcm
. For iOS, it is set as apns
.
To use this feature you should have enabled the Use Clevertap ObjectId for Mapping option in the dashboard, as RudderStack needs the objectId
to upload the device token.
The page
call allows you to record information whenever a user sees a web page, along with its associated properties.
When you send a page
event , RudderStack sends that event to CleverTap as a "Web Page Viewed Page Name
event.
An example of a page
call is shown below:
The screen
method allows you to record whenever a user sees the mobile screen, along with any associated optional properties. This call is similar to the page
call, but is exclusive to your mobile device.
A sample screen
call looks like the following code snippet:
In the above snippet, RudderStack captures all the information related to the screen being viewed, along with any additional info associated with that screen view event. In CleverTap, the above screen
call will be shown as - "Screen Viewed: Sample Screen Name
" along with the properties.
The track
call allows you to capture any action that the user might perform, along with the properties associated with that action. Each action is considered to be an event. It is similar to screen
event, and the user is by default associated with userId
or anonymousId
.
A sample track
call looks like the following:
In the above snippet, RudderStack captures the information related to the Checked Out
event, along with any additional info about that event - in this case the details of the Checked out
event.
To set a specific value to the screen
or track
type event, you need to pass the event
related property in the properties
field.
Note: For track
, page
and screen
events CleverTap does not support arrays or nested objects for custom event properties.
When you track an event with the name Order Completed
using the using Rudderstack's e-commerce tracking API , Rudderstack maps that event to CleverTap’s Charged event.
A number of Rudderstack's specific fields map to CleverTap’s standard Charged
event fields
Rudderstack
CleverTap
checkout_id
Charged ID
revenue
Amount
products
Items
A sample Order Completed
event looks like the following:
The Order Completed
E-Commerce event is free flowing event, if you are setting extra fields for example: discount
, coupon
currency
etc these will be automatically set to Charged
event properties.
The identify
call lets you associate a user with their actions and capture all the relevant traits about them. This information includes unique userid
as well as any optional information such as name
, email
, etc.
A number of Rudderstack's special traits map to CleverTap’s standard user profile fields, as shown in the table below. You will be required to pass the key on the left into Rudderstack and RudderStack will transform it to the key on the right before sending to CleverTap.
Rudderstack
Clevertap
name
Name
birthday
DOB
avatar
Photo
gender
Gender
phone
Phone
email
Email
employed
Employed
education
Education
married
Married
customerType
Customer Type
All other traits will be sent to CleverTap as custom attributes.
A sample identify
call looks like the following:
In the above snippet, RudderStack captures relevant information about the user such as the email
, phone
as well as the associated traits of that user.
If a user already exists, the new values will be updated for that user. Rudderstack automatically maps the userId
(or anoymousId
) to CleverTap user's identity
.
Note: For identify
events CleverTap does not support nested objects for user's traits
.
Profile properties MSG-email
, MSG-push
, MSG-sms
and MSG-whatsapp
are used to set the Do-Not-Disturb status for the user. Unless these are explicitly set to false
, they are always true
.
Example: To disable push notifications for a user, set MSG-push
to false
For queries on any of the sections covered in this guide, you can contact us or start a conversation in our Slack community.