Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Analytics React Native Clevertap Plugin



Getting started

getting-started page anchor
  1. From the Segment web app, click Catalog.
  2. Search for "CleverTap" in the Catalog, select it, and choose which of your sources to connect the destination to.
  3. In the Destination Settings, add the Account Id.

You need to install the @segment/analytics-react-native-plugin-clevertap and the clevertap-react-native dependency.

Using npm:

npm install --save @segment/analytics-react-native-plugin-clevertap clevertap-react-native

Using yarn:

yarn add @segment/analytics-react-native-plugin-clevertap clevertap-react-native

Run pod install after the installation to autolink the Clevertap SDK.

See CleverTap React Native SDK(link takes you to an external page) for more details of this dependency.

(information)

Info

CleverTap requires a number of additional configuration steps which you must do outside of the Segment Clevertap Plugin. Learn more details in the CleverTap React Native Quick Start Guide(link takes you to an external page).


Follow the instructions for adding plugins(link takes you to an external page) on the main Analytics client:

In your code where you initialize the analytics client call the .add(plugin) method with an ClevertapPlugin instance:

1
import { createClient } from '@segment/analytics-react-native';
2
3
import { ClevertapPlugin } from '@segment/analytics-react-native-plugin-clevertap';
4
5
const segmentClient = createClient({
6
writeKey: 'SEGMENT_KEY'
7
});
8
9
segmentClient.add({ plugin: new ClevertapPlugin() });

When you identify a user, Segment passes that user's information to CleverTap with userId as CleverTap's Identity value. A number of Segment's special traits map to CleverTap's standard user profile fields. You'll pass the key on the left into Segment and Segment transforms it to the key on the right before sending to CleverTap.

  • name maps to Name
  • birthday maps to DOB
  • avatar maps to Photo
  • gender maps to Gender
  • phone maps to Phone
  • email maps to Email

All other traits will be sent to CleverTap as custom attributes. The default logic will lower case and snake_case any user traits - custom or special - passed to CleverTap.

(information)

Info

In device mode, CleverTap ignores the anonymous ID and CleverTap injects it's own ID


When you track an event, Segment sends that event to CleverTap as a custom event. Note that CleverTap does not support arrays or nested objects for custom track event properties.

(warning)

Warning

CleverTap requires identify traits like userId or email to record and associate the Track event. Without these traits, the Track event does not appear in CleverTap.

The device mode connection will not lower case or snake_case any event properties passed directly to CleverTap from the client.

Order Completed

order-completed page anchor

When you track an event using the server-side destination with the name Order Completed using the e-commerce tracking API, Segment maps that event to CleverTap's Charged(link takes you to an external page) event.