CleverTap Destination
Destination Info
- Accepts Page, Alias, Identify and Track calls.
- Refer to it as CleverTap in the Integrations object
Once the Segment library is integrated, toggle CleverTap on in your Segment destinations, and add your CleverTap Account ID and CleverTap Account Token which you can find in the CleverTap Dashboard under Settings.
CleverTap supports the Identify, Track, Page (server-side only), and Screen (iOS and server-side only) methods.
You can integrate CleverTap using a server-side or mobile destination (iOS or Android). If you are interested in using CleverTap's push notifications or in-app notifications products, you should use the mobile destinations.
For server-side destination requests, CleverTap requires both the Segment anonymousId and userId in the payload.
CleverTap maintains the server-side and mobile integrations:
For any issues with the server-side and mobile integrations, contact the CleverTap Support team.
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.
namemaps toNamebirthdaymaps toDOBavatarmaps toPhotogendermaps toGenderphonemaps toPhoneemailmaps toEmail
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.
Info
In cloud mode, CleverTap uses Segment anonymous ID as the CleverTap ID. In device mode, CleverTap ignores the anonymous ID and CleverTap injects its own ID.
Warning
Alias is supported by Device-mode Web connections
When you send an Alias call to CleverTap, CleverTap updates the user's profile with the contents of the Alias call.
When you track an event, Segment sends that event to CleverTap as a custom event. 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.
CleverTap does not support arrays or nested objects for custom Track event properties.
The default logic for the cloud mode connection to CleverTap will lower case and snake_case any event properties passed from Segment's servers to CleverTap. The device mode connection will not lower case or snake_case any event properties passed directly to CleverTap from the client.
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 event.
When you send a page event using the server-side destination, Segment sends that event to CleverTap as a Web Page Viewed event.
When you send a screen event using the server-side destination or the iOS bundled SDK, Segment sends that event to CleverTap as an App Screen Viewed event.
-
Add the CleverTap Segment Destination dependency to your app build.gradle:
compile 'com.clevertap.android:clevertap-segment-android:+'Note: The group Id is
com.clevertap.android, notcom.segment.analytics.android.integrations. -
Next, declare CleverTap's destination in your Analytics instance:
1Analytics analytics = new Analytics.Builder(context, "YOUR_WRITE_KEY_HERE")2.use(CleverTapIntegration.FACTORY)3...4.build();
-
In your AndroidManifest.xml, register the following CleverTap services.
1<service2android:name="com.clevertap.android.sdk.FcmTokenListenerService">3<intent-filter>4<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>5</intent-filter>6</service>78<service9android:name="com.clevertap.android.sdk.FcmMessageListenerService">10<intent-filter>11<action android:name="com.google.firebase.MESSAGING_EVENT"/>12</intent-filter>13</service> -
For more in-depth information, visit CleverTap's Android push integration documentation.
-
In your AndroidManifest.xml, add the CleverTap InAppNotificationActivity.
1<activity2android:name="com.clevertap.android.sdk.InAppNotificationActivity"3android:configChanges="orientation|keyboardHidden"4android:theme="@android:style/Theme.Translucent.NoTitleBar" />No further action is required to integrate in-app notifications, which are registered for and requested by default by the CleverTap Segment integration.
CleverTap has created a sample Android application that integrates CleverTap using Segment. Check it out at the GitHub repository.
-
Add the CleverTap Segment Pod to your Podfile:
`pod 'Segment-CleverTap'`Use the latest version on CocoaPods since it will contain the most up to date features and bug fixes.
-
Next, declare CleverTap's integration in your app delegate instance:
1SEGAnalyticsConfiguration *config = [SEGAnalyticsConfiguration configurationWithWriteKey:@"YOUR_WRITE_KEY_HERE"];2[config use:[SEGCleverTapIntegrationFactory instance]];3[SEGAnalytics setupWithConfiguration:config];
-
Follow the directions to register for push at: /docs/connections/sources/catalog/libraries/mobile/ios/#how-do-i-use-push-notifications.
-
In your application's application:didReceiveRemoteNotification: method, add the following:
[[SEGAnalytics sharedAnalytics] receivedRemoteNotification:userInfo]; -
If you integrated the application:didReceiveRemoteNotification:fetchCompletionHandler: in your app, add the following to that method:
[[SEGAnalytics sharedAnalytics] receivedRemoteNotification:userInfo]; -
If you implemented handleActionWithIdentifier:forRemoteNotification:, add the following to that method:
[[SEGAnalytics sharedAnalytics] handleActionWithIdentifier:identifier forRemoteNotification:userInfo];
No further action is required to integrate in-app notifications, which are registered for and requested by default by the CleverTap Segment integration.
CleverTap has created a sample iOS application that integrates CleverTap using Segment. Check it out at the GitHub repository.
If you chose not to bundle the CleverTap Mobile SDK, then you will have to implement your own Push Message processors (and you won't have access to CleverTap's In-App feature).
If you decide to implement your own Push Message processors, then you can pass push tokens to CleverTap using the server-side destination. You can do this by sending it inside context.device.token.
When using Web Device-mode, you can enable verbose logging of all communication with CleverTap servers by setting the theWZRK_D variable in sessionStorage. In the developer console of your browser, enter sessionStorage['WZRK_D'] = '';, you'll see error messages and warnings logged. See the CleverTap Web Quickstart Guide for more details.
You can send computed traits and audiences generated using Engage to this destination as a user property. To learn more about Engage, schedule a demo.
For user-property destinations, an identify call is sent to the destination for each user being added and removed. The property name is the snake_cased version of the audience name, with a true/false value to indicate membership. For example, when a user first completes an order in the last 30 days, Engage sends an Identify call with the property order_completed_last_30days: true. When the user no longer satisfies this condition (for example, it's been more than 30 days since their last order), Engage sets that value to false.
When you first create an audience, Engage sends an Identify call for every user in that audience. Later audience syncs only send updates for users whose membership has changed since the last sync.
Real-time to batch destination sync frequency
Real-time audience syncs to CleverTap may take six or more hours for the initial sync to complete. Upon completion, a sync frequency of two to three hours is expected.
Segment lets you change these destination settings from the Segment app without having to touch any code.
Add your CleverTap Account ID which you can find in the CleverTap Dashboard under Settings.
Optional
**Mobile Only:**Add your CleverTap Account Token which you can find in the CleverTap Dashboard under Settings.
Optional
Server Only: Your dedicated Clevertap region.