CleverTap
Integrate Digia with CleverTap to build 100% native In-App and In-line experiences (no WebViews) across Flutter, Android, iOS, and React Native.
The Digia CleverTap plugin intercepts CleverTap In-App and CleverTap Native Display campaign payloads and pipes them directly into Digia's rendering engine. When a campaign triggers, the plugin maps the incoming payload to your custom UI designs built in the Digia Engage Dashboard, instantly rendering a 100% native experience on the device—no WebViews required. Supported experience types include bottom sheets, dialogs, inline banners, tooltips, and spotlights.
This guide walks you through the end-to-end integration process—covering SDK installation, plugin initialization, and how to map your dashboard campaigns to Digia's native components.
1. Prerequisites
Before integrating, ensure you have:
Digia Access Key: Log in to the Digia Engage Dashboard, open your project, and copy your key from Settings → App Settings.
Active Dashboard Account: Ensure you have an active CleverTap workspace with access to your App/Account IDs.
CleverTap SDK: Installed and initialized (see Flutter, Android, iOS, or React Native Quick Start).
Minimum Supported Versions
Environment: React Native
0.73+Digia packages:
@digia-engage/core,@digia-engage/clevertapCleverTap SDK:
clevertap-react-native: ^4.0.0
Environment:
minSdk 25Digia packages:
tech.digia:engage,tech.digia:engage-clevertapCleverTap SDK:
com.clevertap.android:clevertap-android-sdk:7.3.1
Environment: iOS
16+Digia packages:
DigiaEngage,DigiaEngageCleverTapCleverTap SDK:
CleverTapSDK: 7.5.1
Environment: Dart
>=3.3.0, Flutter>=3.20.0Digia packages:
digia_engage,digia_engage_clevertapCleverTap SDK:
clevertap_plugin: ^3.8.1
2. Install
Note: We assume the core CleverTap SDK is already installed and initialized as part of your standard app setup (see Prerequisites). The snippets below only cover adding the Digia plugin packages.
Install the Digia packages:
Add dependencies in app build.gradle.kts:
Sync the project (Gradle sync).
Add packages using Xcode → File → Add Package Dependencies (or in Package.swift):
Then add these products to your app target dependencies:
DigiaEngageDigiaEngageCleverTap
Add the Digia packages using the flutter pub add command:
3. Initialize Digia with CleverTap
Set up Digia and register the CleverTap plugin during app startup.
JS setup
Android native setup
Important: Even in a React Native app, the CleverTap SDK requires Activity lifecycle registration on the Android side. Without it, all In-App campaigns (including App Launch triggers), push notification click callbacks from the killed state, and session tracking will not work. See the CleverTap React Native Android integration guide.
Extending
CleverTapApplication— registration is handled automatically. No extra call needed.Not extending
CleverTapApplication— callActivityLifecycleCallback.register(this)manually inMainApplication.onCreate(), beforesuper.onCreate():
Also required:
CleverTapRnAPI.initReactNativeIntegration(this)must be called aftersuper.onCreate(). Without it, push notification click callbacks will not fire when the app is in the killed state (ClevertapPushNotificationClickedevent will be lost).
iOS native setup
Important: Even in a React Native app,
CleverTap.autoIntegrate()must be called in your nativeAppDelegatebefore the React bridge initializes. Without it, CleverTap cannot intercept push notifications, deep links, or app launch events on iOS — meaning App Launch triggered campaigns, push notification handling, and In-App display will not work. See the CleverTap React Native iOS integration guide.
Important (Android — Activity Lifecycle Registration): The CleverTap SDK needs to observe Activity lifecycle events to correctly handle In-App campaigns (including App Launch triggers), push notification click callbacks from the killed state, and session tracking. How you register depends on your
Applicationclass setup:
Extending
CleverTapApplication— registration is handled automatically by the superclass. No extra call needed.Not extending
CleverTapApplication— you must callActivityLifecycleCallback.register(this)manually, beforesuper.onCreate(), as shown below.See CleverTap Android integration guide for full details.
Android native setup
Important: Even in a Flutter app, the CleverTap SDK requires Activity lifecycle registration on the Android side. Without it, In-App campaigns (including App Launch triggers), push notification click callbacks from the killed state, and session tracking will not work. See the CleverTap Flutter Android integration guide.
Register
ActivityLifecycleCallbackin yourApplicationclass, beforesuper.onCreate():
iOS native setup
Important: Even in a Flutter app,
CleverTap.autoIntegrate()must be called in your nativeAppDelegatebefore the Flutter engine initializes. Without it, CleverTap cannot intercept push notifications, deep links, or App Launch events on iOS — meaning App Launch triggered campaigns and In-App display will not work. See the CleverTap Flutter iOS integration guide.
Advanced Config Options (React Native)
Digia.initialize() accepts additional fields that control SDK behaviour:
For full details on action types, deep link URL format, onAction usage, and the in-app browser adapter — see Campaign Actions. These apply to all CEP integrations, not just CleverTap.
4. How Digia Maps to CleverTap Campaigns
If you haven't read How It Works in the overview, start there. The section below covers only what is CleverTap-specific.
In short: CleverTap decides who sees a campaign and when. Digia decides what is rendered. The two are linked by a digia_campaign_key you set in the CleverTap dashboard — the Digia plugin reads that key, resolves it against its local cache, and renders the right experience natively.
The table below shows how each Digia experience type maps to a CleverTap campaign type and which SDK component handles it on the app side:
Nudge
DigiaHost
In-App (Custom Code Template)
Receives the DigiaTemplate payload and renders overlay experiences (bottom sheets, dialogs) above app content.
Guide
DigiaAnchor + DigiaHost
In-App (Custom Code Template)
Step-by-step tooltip/spotlight flows anchored to specific UI elements. Each step targets a registered anchorKey.
Survey
DigiaHost
In-App (Custom Code Template)
Multi-step survey flows rendered as overlays.
Inline
DigiaSlot
Native Display
Receives placement key/value pairs and renders inline content (banners, cards) within the app layout.
Here is the end-to-end flow for an In-App campaign (Nudge, Guide, or Survey):
The Campaign Contract
Whatever the experience type, a Digia-powered CleverTap campaign always carries the same two things:
digia_campaign_key(required) — the key of the Digia campaign to render. This alone determines the experience type (nudge, guide, survey, or inline) and its design; nothing about the UI lives in the CleverTap payload.variables(optional) — a JSON object of runtime values interpolated into the campaign at render time (for example a coupon code or the user's name).
CleverTap is the one CEP that delivers this contract through two different campaign types, depending on the experience:
In-App (Custom Code Template)
Nudge, Guide, Survey
As fields on the DigiaTemplate template
DigiaTemplate must be synced once — see Sync DigiaTemplate to Dashboard
Native Display
Inline
As a custom key-value pair
None
The per-experience sections below show exactly where to enter digia_campaign_key and variables for each case.
5. Sync DigiaTemplate to Dashboard
Required before creating any In-App campaign.
DigiaTemplatemust be synced to your CleverTap project before you can create Nudge or Survey campaigns. This is a one-time step per CleverTap project, performed once from a test device.
CleverTap Custom Code In-App Templates are developer-defined presentation units registered with the CleverTap SDK that replace the built-in In-App formats (banners, interstitials, etc.) with fully custom rendering logic. Instead of CleverTap rendering the UI itself, the SDK invokes your registered template handler with the campaign payload — your code decides what to render.
The Digia CleverTap plugin ships a custom code template named DigiaTemplate that acts as this handler. When CleverTap triggers an In-App campaign built on DigiaTemplate, the plugin reads the digia_campaign_key from the payload, looks up the matching Digia campaign, and delegates rendering to Digia's runtime.
Step 1 — Identify the user on the debug device
Call the CleverTap user login method in your debug build to associate the device with a known user.
Step 2 — Mark that user as a test profile
In the CleverTap dashboard, mark only the user from Step 1 as a test profile. See Mark a User Profile as a Test Profile in the CleverTap docs.
Step 3 — Open the app on the test device
No code changes needed. The Digia plugin registers DigiaTemplate with CleverTap automatically at startup. Simply launch the app on the device where the user from Step 1 is already identified — CleverTap will sync the template definition to your project in the background.
Step 4 — Confirm the template is synced
Open In-App → Templates in the CleverTap dashboard and confirm DigiaTemplate appears there before creating any In-App campaign.


6. Setting Up Nudges
Add the Nudge Container
Wrap your app root so overlay campaigns can render above app content.
Jetpack Compose
For screen-triggered campaigns in View/XML flows, report the active screen from onResume():
Trigger a Nudge from CleverTap
Create an In-App campaign in CleverTap using DigiaTemplate. In the campaign template, fill in the following fields:
digia_campaign_key
Yes
promo_offer_sheet
The campaign key copied from the Digia Engage Dashboard. Must match exactly (case-sensitive).
variables
No
{"coupon":"SAVE20"}
Runtime variables to interpolate into the campaign. Enter as a raw JSON string — see note below.
variablesformat: Enter the value as a plain JSON string directly in the CleverTap field. Do not wrap it in outer quotes or escape the inner quotes. The plugin JSON-decodes the string automatically. An invalid JSON value is silently ignored and the campaign renders without variable substitution.
Static variables — hardcoded values set at campaign creation time:
CleverTap personalization variables — CleverTap resolves {{Profile.*}} placeholders at send time using the recipient's user profile, before the value reaches the Digia plugin:
See CleverTap Personalization for the full list of supported {{Profile.*}} and {{Campaign.*}} variables.
7. Setting Up Inline Widgets
DigiaSlot is a composable/widget that renders Digia-powered content inline within your screen layout. Each slot is identified by a placementKey — a string that must match the slot key configured on the inline campaign in the Digia dashboard. When a Native Display campaign whose digia_campaign_key maps to an inline Digia campaign is active, the SDK resolves the campaign and renders it inside the matching slot. If no campaign is active for a slot, it collapses to zero height.
Add an Inline Slot
Place DigiaSlot where you want Native Display content rendered inline.
Jetpack Compose
XML Layout
For View/XML layouts, use DigiaSlotView. It wraps the Compose DigiaSlot API and reads app:placementKey from XML.
Or set the placement programmatically after inflation:
DigiaSlotView requires DigiaHost to be mounted in the same window so the Digia rendering engine is already mounted before the slot renders.
Serve Inline Content from CleverTap
Inline campaigns are delivered the same way as nudges — through a Native Display campaign carrying a digia_campaign_key. Build the inline campaign in the Digia dashboard (it defines which slot / placementKey it renders into), then set digia_campaign_key to the Digia campaign key from that campaign:
digia_campaign_key
Yes
The Digia campaign key of an inline campaign copied from your Digia dashboard. The campaign defines which slot key it renders into.
The app-side DigiaSlot / DigiaSlotView placementKey must match the slot key configured on that campaign in the Digia dashboard.
8. Setting Up Guide Anchors
DigiaAnchor registers a UI element as a named anchor for tooltip and spotlight Guide campaigns. When a Guide campaign runs, the SDK looks up the anchorKey to position the tooltip bubble or spotlight cutout relative to that element.
Wrap any element you want to anchor and give it a unique anchorKey. The key must match exactly what is configured for that step in the Digia dashboard Guide campaign.
Jetpack Compose
XML Layout
Note: If the anchor is not mounted when a Guide campaign fires, the SDK logs an
anchor_not_on_screenhealth event and skips that step. Ensure the anchor is on screen before navigating to the Guide step.
Link the CleverTap Campaign to Digia
To connect a Native Display campaign to your Digia Guide, you must tell CleverTap which Digia campaign to render. In the Digia dashboard, copy the Digia campaign key assigned to your Guide campaign. Then, in the CleverTap Native Display campaign, add a Custom key-value pair with the key set to digia_campaign_key and the value set to the copied key.
Note: The
digia_campaign_keyvalue must exactly match the Digia campaign key from the dashboard. If they differ, the plugin cannot resolve the campaign and nothing renders.
9. Setting Up Surveys
Surveys are multi-step questionnaire flows you design in the Digia dashboard and render as overlays in the nudge host — no extra app-side widget is required beyond the nudge container. A survey is just another campaign type: create it in Digia, then trigger it from CleverTap using DigiaTemplate, exactly like a nudge.
Build the survey campaign in the Digia Engage Dashboard and copy its Digia campaign key.
Ensure your app mounts the nudge container —
DigiaHostat the app root (all platforms).Create a CleverTap In-App campaign using
DigiaTemplateand setdigia_campaign_keyto the survey's Digia campaign key.
digia_campaign_key
Yes
nps_q3_survey
The Digia campaign key of the survey campaign copied from your Digia dashboard.
The survey renders over your app content and reports completion back through the plugin's analytics events.
10. Test Your Integration
Follow these steps to verify end-to-end functionality before releasing:
Verify initialization order —
Digia.initializecompletes, thenDigia.register(DigiaCleverTapPlugin()), beforerunApp/ first activity.Verify host placement —
DigiaHostmust be inMaterialApp.builder(Flutter), the root Composable (Android Compose), or the root SwiftUI wrapper (iOS). For React Native, mount<DigiaHost />once at the app root.Sync
DigiaTemplate— run in debug mode as a CleverTap test user (see Sync DigiaTemplate to Dashboard).Create a test campaign — create an In-App campaign using
DigiaTemplateand trigger it immediately for your test device.Verify inline slots — place
DigiaSlot/DigiaSlotViewon a visible screen, create a Native Display campaign with matching placement keys, and confirm content renders.Verify screen tracking — navigate between screens and confirm that screen-triggered campaigns fire on the correct screen (use
DigiaNavigatorObserveron Flutter,Digia.setCurrentScreen(...)ordigiaScreen("...")in Android View/XML apps, route/screen change hooks callingDigia.setCurrentScreen(...)on Swift, and navigation listeners callingDigia.setCurrentScreen(...)on React Native).
Health Check
Use plugin.healthCheck() to verify plugin wiring. The report shape is platform-specific, but always includes isHealthy plus diagnostic metadata.
11. Troubleshooting
Campaign not rendering
Confirm initialization order —
Digia.initialize(...)thenDigia.register(DigiaCleverTapPlugin()).Android only: Confirm
CleverTapAPI.getDefaultInstance(this)is called beforeDigia.register(...).iOS (Swift): Confirm
CleverTap.autoIntegrate()runs at app start andInfo.plistincludesCleverTapAccountID/CleverTapToken.React Native: Confirm
Digia.initialize(...)andDigia.register(new DigiaCleverTapPlugin(...))are called once during app startup.Ensure
DigiaHostis mounted at the app root.React Native: Ensure
<DigiaHost />is mounted once at app root, andapp.jsoncontains CleverTap plugin credentials.Verify campaign eligibility and trigger conditions in the CleverTap dashboard.
Inline content not showing
Confirm Native Display payload includes placement key/value pairs.
Ensure placement key in payload matches
DigiaSlot('placement_key')orDigiaSlotView app:placementKey.Verify the slot exists on the currently visible screen.
React Native:
DigiaSlotViewauto-sizes to match native content height. If it still appears collapsed, confirm the Native Display campaign is active and theplacementKeymatches. To pin a fixed height, passstyle={{ height: 180 }}.
Screen-triggered campaign not firing
Add
DigiaNavigatorObserver()tonavigatorObservers(Flutter).Call
Digia.setCurrentScreen(...)on navigation changes (Android Compose:navController.addOnDestinationChangedListener).Android XML / Views: Call
digiaScreen("screen_name")fromActivity.onResume()orFragment.onResume().For unnamed routes, call
Digia.setCurrentScreen('screen_name')manually.iOS (Swift): On tab/route changes, call
Digia.setCurrentScreen("screen_name")from your navigation layer.React Native: Wire navigation change events (React Navigation / Expo Router) to
Digia.setCurrentScreen(routeName).
CleverTap default instance is null (Android)
Ensure
ActivityLifecycleCallback.register(this)andCleverTapAPI.getDefaultInstance(this)are called beforeDigia.register(DigiaCleverTapPlugin(applicationContext)).Verify CleverTap credentials are correctly set in
AndroidManifest.xmlper CleverTap Android Quick Start.
Official CleverTap References
Last updated