Step 5: Connect MoEngage campaigns
Link each MoEngage Self-Handled In-App campaign to a Digia Engage campaign with digia_campaign_key, so MoEngage decides who sees it.
Your app is ready to render campaigns. This step shows how a MoEngage campaign tells Digia what to render, and what to set on each campaign type.
How Digia Maps to MoEngage Campaigns
If you haven't read How It Works in the overview, start there. The section below covers only what is MoEngage-specific.
In short: MoEngage 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 MoEngage 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 MoEngage campaign type and which SDK component handles it on the app side:
| Experience Type | Digia Component | MoEngage Campaign Type | Description |
|---|---|---|---|
| Nudge | DigiaHost | Self-Handled In-App | Renders overlay experiences (bottom sheets, dialogs) above app content. |
| Guide | DigiaAnchor + DigiaHost | Self-Handled In-App | Step-by-step tooltip/spotlight flows anchored to specific UI elements. Each step targets a registered anchorKey. |
| Survey | DigiaHost | Self-Handled In-App | Multi-step survey flows rendered as overlays. |
| Inline | DigiaSlot | Self-Handled In-App | Renders inline content (banners, cards) within the app layout at a matching placement. |
Here is the end-to-end flow for a Self-Handled In-App campaign (Nudge, Guide, Survey, or Inline):
The Campaign Contract
Whatever the experience type, a Digia-powered MoEngage campaign carries the same payload in its Campaign data / Key-Value Pairs field — a single JSON object:
{
"digia_campaign_key": "promo_offer_sheet",
"variables": {
"coupon": "SAVE20",
"offer_title": "Limited Offer"
}
}
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 MoEngage payload.variables(optional) — a JSON object of runtime values interpolated into the campaign at render time.
Every experience type — nudge, guide, survey, and inline — is delivered through the same Self-Handled In-App campaign with this same payload. The per-experience sections below show it in context.
Self-Handled In-App Campaigns
MoEngage supports a delivery mode called Self-Handled In-App Campaigns — instead of MoEngage rendering its own campaign UI, the SDK delivers the campaign payload to your app code. The Digia MoEngage plugin registers a self-handled in-app listener that intercepts this payload, extracts the digia_campaign_key, resolves it against the Digia campaigns pre-fetched at startup, and delegates rendering to Digia's runtime. Without setting the campaign template type to Self Handled in the MoEngage dashboard, the payload will not be delivered to the plugin.
No device-side sync is required — the plugin responds automatically once registered. Configure your campaign in the MoEngage dashboard:
- Log in to the MoEngage dashboard and go to Engage → In-App (NATIV).
- Click Create Campaign and give it a name.
- Set the Template type to Self Handled.
- Configure the event trigger, audience, and schedule as required.
- In the Campaign data / Key-Value Pairs field, add a key named
digia_campaign_keywith the Digia campaign key copied from your Digia dashboard.
See MoEngage Self-Handled In-App.
Trigger a Nudge from MoEngage
Create a Self-Handled In-App campaign in MoEngage. In the Campaign data / Key-Value Pairs field, provide the digia_campaign_key that links to your Digia campaign:
{
"digia_campaign_key": "promo_offer_sheet"
}
| Field | Required | Example value | Description |
|---|---|---|---|
digia_campaign_key | Yes | promo_offer_sheet | The Digia campaign key copied from your Digia dashboard. Its type (nudge / guide / survey / inline) and design come from Digia, not the payload. |
variables | No | {"coupon":"SAVE20"} | Optional JSON map of runtime variables interpolated into the campaign at render time. |
Linking: In the Digia dashboard, copy the Digia campaign key assigned to your campaign. In the MoEngage Self-Handled In-App campaign's Key-Value Pairs, add a key named
digia_campaign_keywith that value. If the values differ, the plugin cannot resolve the campaign and nothing renders.
variablesformat: Enter the value as plain JSON text directly in the field — e.g.,{"coupon":"SAVE20"}. Do not wrap it in outer quotes. The plugin JSON-decodes the payload automatically.
Serve Inline Content from MoEngage
DigiaSlot is a composable/widget that renders Digia-powered content inline within your screen layout. Each slot is identified by a placementKey. When a Self-Handled In-App campaign whose digia_campaign_key maps to an inline Digia campaign triggers, Digia renders that campaign into the slot whose placementKey matches the slot key configured on the campaign in the Digia dashboard. If no campaign is active for a slot, it collapses to zero height.
Inline campaigns are delivered the same way as nudges — through a Self-Handled In-App campaign carrying a digia_campaign_key. Build the inline campaign in the Digia dashboard (it defines which slot / placementKey it targets), then set digia_campaign_key to the Digia campaign key from that campaign:
{
"digia_campaign_key": "home_hero_banner_campaign"
}
| Field | Required | Description |
|---|---|---|
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.
Inline content stays loaded once a campaign renders it — it doesn't clear when the user's context changes. To clear it (for example on logout), see Managing Inline Content.
Link the MoEngage Campaign to Digia
To connect a MoEngage campaign to your Digia Guide, copy the Digia campaign key assigned to your Guide campaign in the Digia dashboard. Then, in the MoEngage Self-Handled In-App campaign's Key-Value Pairs, add a key named digia_campaign_key with that value:
{
"digia_campaign_key": "onboarding_tour"
}
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.
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 MoEngage by referencing its Digia campaign key via digia_campaign_key, 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 MoEngage Self-Handled In-App campaign and add a
digia_campaign_keyKey-Value Pair set to the survey's Digia campaign key.
{
"digia_campaign_key": "nps_q3_survey"
}
The survey renders over your app content and reports completion back through the plugin's analytics events.
Personalize with variables
A Digia campaign shows personal values, such as a user's name or an offer amount, through
{{ variable }} placeholders:
- Your campaign team declares the variables in the Digia campaign's Setup → Variables step,
each with a fallback value. Names use lowercase letters, digits and underscores, like
first_name. - The MoEngage campaign sends the values. A value that's missing or empty uses the fallback.
- Let MoEngage fill in each user's value with its personalization tags, so every user sees their own.
The campaign's Integration details panel in the Digia dashboard (on the Review step) gives you a ready-to-paste MoEngage config with a tag for each variable.
Keep every value in quotes. A value without quotes can make the whole set of variables unreadable.
Put the values in the variables object of the Self-Handled payload. Only the keys inside
variables are used:
{
"digia_campaign_key": "promo_offer_sheet",
"variables": {
"first_name": "{{UserAttribute['first_name']|default('there')}}",
"offer_amount": "20"
}
}
When several campaigns match
When one trigger matches several MoEngage campaigns, MoEngage shows only one, picked by its own
rules (see MoEngage's documentation). Digia shows the campaign MoEngage
sends. Digia also shows only one popup at a time: a campaign that arrives while another is on screen
is dropped as surface_busy. See When Campaigns Overlap.
Only target app versions that have Digia
A MoEngage campaign that points at a Digia campaign only works in app versions that include the Digia SDK. Users still on an older version of your app receive the MoEngage campaign too, but their app has nothing to show it with, so it doesn't appear correctly for them.
Add an app version condition to the MoEngage campaign, so it only targets your first app release with Digia and later. Raise that version again when a campaign uses something only a newer Digia SDK supports.