Send your event data from RudderStack to CleverTap.

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.

Find the open source transformer code for this destination in the GitHub repository.

Connection compatibility

Destination Information
  • Status: Generally Available
  • Supported sources: Android (Java) , Android (Kotlin) , iOS (Obj-C) , iOS (Swift) , Web, Unity, AMP , Cloud, Warehouse, React Native , Flutter, Cordova, Shopify
  • Refer to it as CleverTap in the Integrations object.
Connection Modes
SourceCloud modeDevice modeHybrid modeDevice Mode Transformations
AMPsupportednot supportednot supportednot supported
Android (Java)supportedsupportednot supportedsupported
Android (Kotlin)supportedsupportednot supportednot supported
Cloudsupportednot supportednot supportednot supported
Cordovasupportednot supportednot supportednot supported
Fluttersupportednot supportednot supportednot supported
iOS (Obj-C)supportedsupportednot supportedsupported
iOS (Swift)supportedsupportednot supportednot supported
React Nativesupportedsupportednot supported
Shopifysupportednot supportednot supportednot supported
Unitysupportednot supportednot supportednot supported
Warehousesupportednot supportednot supportednot supported
Websupportedsupportednot supportedsupported
Supported Message Types
SourceIdentifyPageTrackScreenGroupAliasRecordAudienceList
Cloud mode
Supported sourcessupportedsupportedsupportedsupportednot supportedsupportednot supportednot supported
Device mode
Android (Java)supportednot supportedsupportedsupportednot supportednot supportednot supportednot supported
Android (Kotlin)supportednot supportedsupportedsupportednot supportednot supportednot supportednot supported
iOS (Obj-C)supportednot supportedsupportedsupportednot supportednot supportednot supportednot supported
iOS (Swift)supportednot supportedsupportedsupportednot supportednot supportednot supportednot supported
React Nativesupportednot supportedsupportedsupportednot supportednot supportednot supportednot supported
Websupportedsupportedsupportednot supportednot supportednot supportednot supportednot supported

In the web device mode integration, that is, using the JavaScript SDK as a source, RudderStack loads the CleverTap native SDK from thehttps://d2r1yp2w7bby2u.cloudfront.net domain.

Based on your website’s content security policy, you may need to allowlist this domain to load the CleverTap SDK.

Get started

Once you have confirmed that the source platform supports sending events to CleverTap, follow these steps:

  1. From your RudderStack dashboard, add a source. Then, from the list of destinations, select CleverTap.
  2. Assign a name to the destination and click Continue.

Connection settings

Setting
Description
Account IDYour account ID is a unique ID generated for your account. You can find it in your account Settings as your Project ID.
PasscodeYour account passcode is a unique code generated for your account. You can find it in your CleverTap dashboard by going to Settings > Passcode.
Account TokenYour CleverTap account token — this setting is required for mobile device mode integrations, including iOS (Swift) and Android (Kotlin).
Enable track for anonymous userEnable this option to track anonymous users in CleverTap.
Use CleverTap ObjectId for MappingEnable this option to use both CleverTap objectId along with identity for mapping events from RudderStack to CleverTap.
RegionSelect your CleverTap region.
Client-side Events FilteringSpecify which events should be blocked or allowed to flow through to CleverTap.

For more information on this setting, see the Client-side Events Filtering guide.
Consent management settingsConfigure the consent management settings for the specified source by choosing the Consent management provider from the dropdown and entering the relevant consent category IDs.

See Consent Management in RudderStack for more information.
Use device mode to send eventsToggle on this setting to send events in device mode.
All server-side destination requests require either an anonymousId or a userId in the payload.

Adding device mode integration

Follow these steps to add CleverTap to your Swift project using Swift Package Manager:

  1. In Xcode, select File > Add Package Dependencies….
  1. Enter the below package repository URL in the search bar:
https://github.com/rudderlabs/integration-swift-clevertap/
  1. Select the latest version and the target to which you want to add the package.
  2. Click Add Package.

Alternatively, you can add the dependency to your Package.swift file, as shown:

swift
dependencies: [
    .package(url: "https://github.com/rudderlabs/integration-swift-clevertap.git", from: "<latest_integration_version>")
]

Usage

  1. Import the SDK and the integration:
swift
import RudderStackAnalytics
import RudderIntegrationCleverTap
  1. Add CleverTapIntegration to your analytics instance:
swift
// Initialize RudderStack Analytics
let analytics = Analytics(
    configuration: Configuration(
        writeKey: "<WRITE_KEY>",
        dataPlaneUrl: "<DATA_PLANE_URL>"
    )
)

// Add CleverTap Integration
analytics.add(plugin: CleverTapIntegration())

The Swift integration initializes the CleverTap iOS SDK from your RudderStack dashboard settings when you enable device mode. Configure Account ID, Account Token, and Region in the destination settings before adding the plugin to your app. Server-side CleverTap API requests use the Passcode setting. To set up CleverTap in your app instead, see Use your own CleverTap instance.

Use your own CleverTap instance

By default, the integration initializes the CleverTap SDK from the destination configuration. Instead, you can also set up CleverTap in your app and pass that CleverTap instance to the integration, which then only maps your events and sends them to your instance.

With your own instance, you can:

  • Start CleverTap at app launch. The integration creates CleverTap only after the RudderStack SDK gets the destination settings. Until then, no CleverTap instance exists. On Android, CleverTap can then drop a push notification that arrives while the app is closed, and it misses the first screen.
  • Pass any CleverTap instance, for example, one that you create with your own CleverTapInstanceConfig. Without your instance, the integration always uses the default CleverTap instance.
  • Keep your existing CleverTap setup. Your app’s CleverTap credentials decide the account. The integration doesn’t use the credentials from the destination configuration.
You can use your own CleverTap instance in the CleverTap Android (Kotlin) integration v2.1.0 and above.
  1. Add the CleverTap Android SDK to your module (app-level) Gradle file. Use a version in the range [8.4.1, 9.0.0):
This step does not increase your app size. The CleverTap integration already includes the CleverTap Android SDK as a transitive dependency, so the SDK is already packaged in your app.
kotlin
dependencies {
  // ...
  implementation("com.clevertap.android:clevertap-android-sdk:<version>")
}
  1. Add your CleverTap account ID and account token to the application tag of your AndroidManifest.xml file. If your account uses a region, also add CLEVERTAP_REGION.
xml
<application>
    <meta-data android:name="CLEVERTAP_ACCOUNT_ID" android:value="YOUR_ACCOUNT_ID" />
    <meta-data android:name="CLEVERTAP_TOKEN" android:value="YOUR_ACCOUNT_TOKEN" />
    <!-- Only if your account uses a region -->
    <meta-data android:name="CLEVERTAP_REGION" android:value="YOUR_REGION" />
</application>
  1. In your Application class, register CleverTap’s activity tracking and create the CleverTap instance. Do both before you initialize the RudderStack SDK. Then pass the instance to the integration:
kotlin
import android.app.Application
import com.clevertap.android.sdk.ActivityLifecycleCallback
import com.clevertap.android.sdk.CleverTapAPI
import com.rudderstack.integration.kotlin.clevertap.CleverTapIntegration
import com.rudderstack.sdk.kotlin.android.Analytics
import com.rudderstack.sdk.kotlin.android.Configuration

class MyApplication : Application() {
    lateinit var analytics: Analytics

    override fun onCreate() {
        // Lets CleverTap track the first screen, notification clicks, and deep links.
        ActivityLifecycleCallback.register(this)
        super.onCreate()

        // Creates the CleverTap instance from the manifest entries.
        val cleverTap = CleverTapAPI.getDefaultInstance(this)

        analytics = Analytics(
            configuration = Configuration(
                writeKey = "WRITE_KEY",
                application = this,
                dataPlaneUrl = "DATA_PLANE_URL",
            )
        )
        cleverTap?.let { analytics.add(CleverTapIntegration(it)) }
    }
}

Important considerations

  • Do not call ActivityLifecycleCallback.register or getDefaultInstance without the manifest entries from step 2. CleverTap reads its credentials only once, when it starts. Without the manifest entries, getDefaultInstance returns no instance.
  • Create the CleverTap instance on the main thread, in Application.onCreate. Do not create it on a background thread or executor. When a push notification starts a closed app, the CleverTap instance must exist before its push handler runs.
  1. In each activity that a notification can open, forward the notification click and the deep link from onNewIntent:
kotlin
import android.content.Intent
import com.clevertap.android.sdk.CleverTapAPI

// In your activity
override fun onNewIntent(intent: Intent) {
    super.onNewIntent(intent)
    setIntent(intent)
    val cleverTap = CleverTapAPI.getDefaultInstance(this)
    cleverTap?.pushNotificationClickedEvent(intent.extras)
    cleverTap?.pushDeepLink(intent.data)
}

If you pass an instance that you created with CleverTapInstanceConfig, call these methods on that instance. getDefaultInstance returns only the default instance.

The CleverTap integration v2.0.0 has no constructor that takes an instance. With v2.0.0, follow steps 1 to 4, but add CleverTapIntegration() in step 3. The integration then reuses your default CleverTap instance:

  • CleverTap keeps the credentials it started with, from the manifest entries. The credentials from the destination settings have no effect, but they must still hold valid values. Without them, the integration does not create the destination.
  • CleverTap registers its activity tracking only once. The register call of the integration has no effect.

Call CleverTap APIs

Get the CleverTap instance anywhere in your app with CleverTapAPI.getDefaultInstance(context). If you pass an instance that you created with CleverTapInstanceConfig, use that instance instead. For example, to use Native Display:

kotlin
import com.clevertap.android.sdk.CleverTapAPI

val cleverTap = CleverTapAPI.getDefaultInstance(context)

cleverTap?.setDisplayUnitListener { units ->
    // Render the display units.
}

// unitId: the ID of a display unit, from CleverTapDisplayUnit.unitID
val units = cleverTap?.allDisplayUnits
val unit = cleverTap?.getDisplayUnitForId(unitId)
cleverTap?.pushDisplayUnitViewedEventForID(unitId)
cleverTap?.pushDisplayUnitClickedEventForID(unitId)

When you pass your own CleverTap instance, the integration:

  • Doesn’t set the CleverTap credentials or the debug level.
  • Doesn’t register CleverTap’s activity tracking on Android, or notify CleverTap of the app launch on iOS. Your app does this.
  • Still follows the destination configuration for the events that it sends: the destination on/off switch, consent, and event filtering.
  • Waits for the source configuration before it sends events.

On Android, the integration’s helper methods pushNotificationClickedEvent, pushDeepLink, and setAppForeground still work.

  • The Account ID and Account Token connection settings still need a value. The integration doesn’t use them.
  • For the default CleverTap instance, your app’s manifest or Info.plist entries decide the account. To change the account, change these entries and release a new version of the app. For an instance that you create with CleverTapInstanceConfig, the credentials in that config decide the account.
  • If you disable the CleverTap destination in the dashboard, RudderStack stops sending events to CleverTap. CleverTap still runs in your app and still shows push notifications.

Identify

The identify call lets you associate a user with their actions and capture relevant traits about them. This information includes userId and other user information like name, email, etc.

RudderStack requires either userId or email to send identify events to CleverTap.

RudderStack maps the following user traits to the CleverTap attributes:

RudderStackCleverTap
nameName
birthdayDOB
avatarPhoto
genderGender
phonePhone
emailEmail
employedEmployed
educationEducation
marriedMarried
customerTypeCustomer Type

RudderStack sends all other traits to CleverTap as custom attributes.

Phone number format requirement

CleverTap requires phone numbers to be formatted as +[country code][phone number] (for example, +14155551234 for a U.S. phone number).

RudderStack does not modify the phone format in its integration logic — hence, ensure your phone numbers are properly formatted before sending them through RudderStack.

See the CleverTap Upload User Profiles API documentation for more information.

A sample identify call looks like the following:

javascript
rudderanalytics.identify("userid", {
  name: "Name Surname",
  email: "name@website.com",
  phone: "+14155551234",
  birthday: "birthday",
  gender: "M",
  avatar: "link to image",
  title: "Owner",
  organization: "Company",
  city: "Tokyo",
  region: "ABC",
  country: "JP",
  zip: "100-0001",
  Flagged: false,
  Residence: "Shibuya",
  MSG-email: false
});

In the above snippet, RudderStack captures relevant information about the user such as the email and phone, along with the associated user traits.

Note that:

  • If a user already exists, the new values will be updated for that user. RudderStack automatically maps the userId (or anoymousId) to CleverTap’s identity attribute.
  • The profile properties MSG-email, MSG-push, MSG-sms and MSG-whatsapp are used to set the Do Not Disturb (DND) status for the user. They are always true by default, unless you explicitly set them to false. For example, to disable push notifications for a user, set MSG-push to false.

Privacy options

When loading the RudderStack SDK, you can set the following options in the CLEVERTAP integrations object:

OptionData typeNotes
optOutBooleanDefaults to false. Set to true if the user opts out of sharing their data.
useIPBooleanDefaults to false. Set to true if the user agrees to share their IP data.
javascript
rudderanalytics.load(
  "WRITE_KEY",
  "DATAPLANE_URL", {
    configUrl: "https://api.rudderlabs.com",
    logLevel: "DEBUG",
    integrations: {
      CleverTap: {
        optOut: true,
        useIP: true,
      }
    }
  }
);

CleverTap does a reverse lookup on the IP of the incoming request in the back end to map the user’s location. Under GDPR laws, user consent is required to initiate this lookup. Use the useIP flag in the web SDK to provide that consent.

If useIP is set to true, the city/country information will populate on the Profile page of the CleverTap dashboard. If set to false, then this data won’t be populated, and the city/country information will be shown as Unknown, Unknown.

See the CleverTap documentation for more information.

Delete a user

You can delete a user in CleverTap using the Suppression with Delete regulation of the RudderStack User Suppression API.

While RudderStack forwards the deletion request, it does not guarantee deletion within a 30-day window. You will need to check with CleverTap if the request is fulfilled.

To delete a user, specify their userId in the event. Additionally, you can specify a custom identifier (optional) in the event.

A sample regulation request body for deleting a user in CleverTap is shown below:

json
{
  "regulationType": "suppress_with_delete",
  "destinationIds": [
    "2FIKkByqn37FhzczP23eZmURciA"
  ],
  "users": [{
    "userId": "1hKOmRA4GRlm",
    "<customKey>": "<customValue>"
  }]
}

Track

The track call lets you capture user events along with the properties associated with them. The user is associated with userId or anonymousId by default.

A sample track call looks like the following:

javascript
rudderanalytics.track("Checked Out", {
  Clicked_Rush_delivery_Button: true,
  total_value: 2000,
  revenue: 2000,
})

In the above snippet, RudderStack captures the information related to the Checked Out event, along with any additional info about that event.

CleverTap does not support nested objects or arrays for custom attributes in the track events. Hence, RudderStack converts the nested objects or arrays into strings before sending them to CleverTap.

Order Completed

When you track an event with the name Order Completed using the using the RudderStack Ecommerce Events tracking, RudderStack maps it to CleverTap’s Charged event.

A number of RudderStack’s specific fields map to CleverTap’s standard Charged event fields

RudderStackCleverTap
checkout_idCharged ID
revenueAmount
productsItems

A sample Order Completed event looks like the following:

javascript
rudderanalytics.track("Order Completed", {
  checkout_id: "12345",
  order_id: "1234",
  affiliation: "Apple Store",
  "Payment mode": "Credit Card",
  total: 20,
  revenue: 15.0,
  shipping: 22,
  tax: 1,
  discount: 1.5,
  coupon: "Games",
  currency: "USD",
  products: [
    {
      product_id: "123",
      sku: "G-32",
      name: "Monopoly",
      price: 14,
      quantity: 1,
      category: "Games",
      url: "https://www.website.com/product/path",
      image_url: "https://www.website.com/product/path.jpg",
    },
    {
      product_id: "345",
      sku: "F-32",
      name: "UNO",
      price: 3.45,
      quantity: 2,
      category: "Games",
    },
    {
      product_id: "125",
      sku: "S-32",
      name: "Ludo",
      price: 14,
      quantity: 7,
      category: "Games",
      brand: "Ludo King",
    },
  ],
})
Order Completed is a free-flowing event. If you set extra fields like discount, coupon, currency, etc., RudderStack automatically maps them to the Charged event properties.

Page

The page call lets you record your website’s page views with any additional relevant information about the viewed page.

RudderStack sends a page event to CleverTap as a Web Page Viewed <Page_Name> event.

An example of a page call is shown below:

javascript
rudderanalytics.page("Cart", "Cart Viewed", {
  path: "/cart",
  referrer: "test.com",
  search: "term",
  title: "test_item",
  url: "http://test.in",
})
CleverTap does not support nested objects or arrays for custom attributes in the page events. Hence, RudderStack converts the nested objects or arrays into strings before sending them to CleverTap.

Screen

The screen method lets you record whenever your user views their mobile screen, with any additional relevant information about the screen.

A sample screen call is shown:

objectivec
[[RSClient sharedInstance] screen:@"Sample Screen Name"
        properties:@{@"prop_key" : @"prop_value"}];

In the above snippet, RudderStack captures all 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: <screen_name> along with the properties.

CleverTap does not support nested objects or arrays for custom attributes in the screen events. Hence, RudderStack converts the nested objects or arrays into strings before sending them to CleverTap.

Alias

The alias call lets you merge different identities of a known user.

A sample alias call is shown below:

javascript
rudderanalytics.alias("newUserId","userId");

Configure push notifications and in-app messages

Use the JavaScript SDK’s device mode integration for web push. RudderStack loads CleverTap’s Web SDK; your website hosts the service worker and requests notification permission through CleverTap’s API.

Configure web push

  1. Connect your JavaScript source to CleverTap and enable Use device mode to send events in the Connection settings. Use the Account ID and Region for the CleverTap project where you configure web push.

  2. In CleverTap, open Settings > Engage > Channels > Web Push. Generate and upload your VAPID keys, then enable each browser channel you support. For Chrome, enable Chrome Web Push. See Generating VAPID keys for instructions. Keep the private key out of your website code.

Saving VAPID keys doesn’t activate a browser channel. Chrome Web Push must be enabled for Chrome to receive its push configuration and public key.
  1. For the queued soft prompt example below, enable Soft Prompt > Card Popup in CleverTap’s Web Push settings. See Soft prompt setup.

Host the service worker

Download clevertap_sw.js and host it at your website’s document root:

https://www.example.com/clevertap_sw.js

This URL must return JavaScript, not your app’s HTML page. In React, Next.js, or Vite, you can usually place the file in public/clevertap_sw.js.

The worker’s entry file must be served from your website’s origin. If you already have a service worker, follow Integration with existing service worker file and use its path as serviceWorkerPath in the examples below.

Initialize the SDK

Initialize the CleverTap global and queues in your page’s <head> before the JavaScript SDK installation snippet:

html
<script>
  window.clevertap = window.clevertap || {};
  window.clevertap.event = window.clevertap.event || [];
  window.clevertap.profile = window.clevertap.profile || [];
  window.clevertap.onUserLogin = window.clevertap.onUserLogin || [];
  window.clevertap.notifications = window.clevertap.notifications || [];
  window.clevertap.privacy = window.clevertap.privacy || [];
</script>

Don’t set window.clevertap.account. RudderStack replaces it with the Account ID from your destination settings and ignores any account set on the page. If the page sets a different account, RudderStack also removes the page’s region, targetDomain, and token, and uses the Region from your destination settings.

The integration supports one CleverTap account per page. Don’t load CleverTap’s SDK separately: if it’s already loaded when RudderStack initializes the destination, RudderStack replaces it.

Install and initialize RudderStack once with your source write key and data plane URL. For single-page apps, use shared client-side startup code. You don’t need a separate CleverTap installation snippet.

Queue a permission request

Call the following from your page or app after a meaningful action, such as completing a purchase:

javascript
window.clevertap.notifications.push({
  titleText: "Receive order updates?",
  bodyText: "Get notifications about your orders.",
  okButtonText: "Enable",
  rejectButtonText: "Later",
  skipDialog: false,
  serviceWorkerPath: "/clevertap_sw.js",
});

You can queue this request before CleverTap loads without waiting for rudderanalytics.ready(). The integration preserves the existing global and queued calls, except the account; CleverTap processes the request through its initialization flow.

Once CleverTap loads, the same API calls go directly to its SDK.

Queue one permission request per interaction. Queuing doesn’t bypass your destination or consent settings: a request isn’t processed if the destination doesn’t load. Continue using rudderanalytics.identify() for signed-in users and rudderanalytics.track() for analytics events.

Use SDK readiness for a direct prompt

Use rudderanalytics.ready() when your page needs the SDK’s readiness signal or an initialized CleverTap instance. This callback waits for RudderStack and its device mode destinations to initialize; queued calls don’t require it.

For example, enable a notification button in the callback, then request the native browser prompt when the user clicks the button:

html
<button id="enable-web-push" disabled>Enable notifications</button>
<script>
  const pushButton = document.getElementById("enable-web-push");

  // Run after your existing RudderStack initialization.
  rudderanalytics.ready(() => {
    const ct = window.clevertap;
    if (!ct || ct.logout === undefined || !ct.notifications) return;

    pushButton.disabled = false;
    pushButton.addEventListener("click", () => {
      ct.notifications.push({
        skipDialog: true,
        serviceWorkerPath: "/clevertap_sw.js",
      });
    });
  });
</script>

Keep the native permission request in the click handler. Browsers may require a fresh user interaction, which a queued request or a ready() callback doesn’t preserve. The soft prompt provides that interaction after the SDK loads.

Verify web push

  1. Open your HTTPS website in a regular browser window. For local desktop Chrome testing, http://localhost is supported. Chrome treats localhost as a secure context, and CleverTap’s SDK allows it over HTTP. See Service Worker API.
  2. Trigger the permission request and accept the soft prompt and browser permission. CleverTap registers the service worker during subscription; loading its SDK alone doesn’t register the worker.
  3. Confirm that notification permission is granted, the service worker is active, and a push subscription exists. Then send a test Web Push campaign from CleverTap to the subscribed browser or user profile.

For iOS/iPadOS, configure a web app manifest and have users add your website to their Home Screen before requesting permission. See iOS/iPadOS web push configurations.

Web push is not supported in private browsing or embedded app browsers.

Troubleshoot web push

SymptomCheck
CleverTap loads, but no prompt appearsEnable the browser’s Web Push channel and configure VAPID keys in the same CleverTap project as the destination. Enable Card Popup for the soft prompt. SDK readiness doesn’t confirm that a push channel is enabled.
The worker isn’t registered yetComplete the permission flow. Worker registration happens during subscription, not when the SDK loads. Check that /clevertap_sw.js serves JavaScript from your website’s origin.
The worker is active, but notifications don’t arriveConfirm browser permission is granted and a push subscription exists. Check that the test campaign targets the subscribed browser or user profile. Worker activation alone doesn’t create a subscription.

Using CleverTap objectId and identity for mapping

This section is applicable when sending events in cloud mode.

CleverTap uniquely identifies each user with two main identifiers, namely objectId and identity. When you enable the Use CleverTap ObjectId for Mapping option in the dashboard, RudderStack uses both objectId and identity and expects the following mapping:

  • For identify events:
RudderStackRudderStackCleverTapCleverTap
anonymousId present?userId present?objectIdidentity
YesYesanonymousIduserId
YesNoanonymousId-
NoYesCleverTap-generated UUIDuserId
  • For track events:
RudderStackRudderStackCleverTapCleverTap
anonymousId present?userId present?Tracking withValue
YesYesobjectIdanonymousId
YesNoobjectIdanonymousId
NoYesidentityuserId

If Use CleverTap ObjectId for Mapping setting is disabled in the dashboard, RudderStack expects the following mapping for identifying users and tracking events (track/page/screen):

RudderStackCleverTap
userId or anonymousIdidentity

Why use CleverTap objectId for mapping?

When you track an unidentified user in CleverTap, a user profile is created with minimal details along with the user activity details. 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 userId identifier (in case of RudderStack) which maps to CleverTap’s identity attribute.

One way to solve this problem is to track users only in cases where a userId is present. To do so, disable the Enable tracking for anonymous users option in the RudderStack dashboard. Alternatively, you can turn on 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.

Upload device token in cloud mode

This section is applicable for the Android (Java) and iOS (Obj-C) sources when sending events via cloud mode.

When the device token is present in context.device.token in identify calls, RudderStack uses CleverTap’s Upload Device Tokens 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, enable the Use CleverTap ObjectId for Mapping option in the dashboard as RudderStack needs the objectId to upload the device token.

You can also define the token type irrespective of your operating system by sending your choice of device token via the event’s integrations object. The supported token types are listed below:

  • chrome
  • fcm
  • gcm
  • apns
  • wns
  • mpns

A sample integrations object is shown below:

javascript
integrations: {
  All: true,
  CleverTap: {
    deviceTokenType: 'apns',
  },
}

For the chrome device token type, you can also send the chromeKeys object within the integrations object, as shown:

javascript
 integrations: {
   All: true,
   CleverTap: {
     deviceTokenType: 'chrome',
     chromeKeys: {
       p256dh: '<value>',
       auth: '<value>'
     },
   },
 },

See the CleverTap documentation on uploading device tokens for more details.


Questions? Let's figure it out together.

Join the RudderStack Slack community to connect with other users, customers, and the RudderStack team — or reach out for direct support.