Edit in GitHubLog an issue

Trigger Adobe Journey Optimizer campaigns using the send data to platform event

This guide explains how to set up, then trigger Adobe Journey Optimizer campaigns by using the send data to platform event trigger available in the Adobe Journey Optimizer UI.

Prerequisites

AJO Campaign setup

  1. Create a scheduled campaign containing an in-app message action. send-data-event-in-app-action
  2. In-app campaigns (as well as content cards) support rule based triggers. For this example, we will create a campaign containing an in-app message action which will be triggered using the "Send data to platform event". Click "Edit Triggers" and setup a "Send data to Platform" event trigger with a condition of "XDM value". The created condition will be satisfied by a defined key value pair. The key value pair must be present within an Experience event request sent by your app. For this example, we will use a key of "status" and a value of "signedIn" to show our in-app message when a user has signed in to our app. send-data-event-define-rule
  3. The completed in-app campaign with the "Send data to platform event" trigger setup will look like: send-data-event-trigger-setup
  4. Review and activate the campaign after the in-app action content authoring is complete.

Trigger the campaign using the send data to platform event

To trigger an Adobe Journey Optimizer campaign, you need to send an Experience event to Experience Platform. This event should contain the data that matches your campaign's trigger conditions.

Triggering a campaign using a simple key and value pair:

The basic example described above will have a rule trigger created on the AJO UI which looks like:

Copied to your clipboard
(Sent data to Platform event happens) AND (XDM value status = signedIn)

We can then trigger the campaign using a map containing the specified key value pair:

Copied to your clipboard
// Create an Experience Event
val xdmData = mapOf("status" to "signedIn")
val signinEvent = ExperienceEvent.Builder()
.setXdmSchema(xdmData)
.build()
// Send the event to the experience platform
Edge.sendEvent(signinEvent, null)

Triggering a campaign using a key and value pair nested in a map

If we have a more complex map named userDetails nested within another map named user:

Copied to your clipboard
"user": {
"userDetails": {
"status": "signedIn",
"firstName": "John",
"lastName": "Doe"
},
"identifiers" : {
"ECID": "28649146398838158895030626237041592948",
"someOtherId": "e374aed66f6a3fda58aacb2d5e2cae5ce8d6ad1bbea2fedfd2640ac0d5be8d2e"
}
},

We can setup a rule trigger on the AJO UI which uses a dot notation to access the nested map's key value pairs:

send-data-event-define-nested-rule

We can then trigger the campaign using XDM data containing nested maps:

Copied to your clipboard
// Create an Experience Event
val userDetails = mapOf("status" to "signedIn", "firstName" to "John", "lastName" to "Doe")
val identifiers = mapOf("ECID" to "28649146398838158895030626237041592948", "someOtherId" to "e374aed66f6a3fda58aacb2d5e2cae5ce8d6ad1bbea2fedfd2640ac0d5be8d2e")
val userData = mapOf("userDetails" to userDetails, "identifiers" to identifiers)
val xdmData = mapOf("user" to userData)
val signinEvent = ExperienceEvent.Builder()
.setXdmSchema(xdmData)
.build()
// Send the event to the experience platform
Edge.sendEvent(signinEvent, null)

Triggers using values within arrays in event data

You can use a key-value pair within an array in the event data by specifying its full path along with its index in the array. Please see the Event data key flattening section for more information.

For example, you can trigger an in-app message when an event sent to Experience Platform has the key-value pair "sku": "1234" in the productlistitems array in its event data.

Copied to your clipboard
"xdm": {
"productlistitems": [
{
"sku": "1234"
},
{
"sku": "4567"
}
]
},

In this case, the condition can be specified as:

Copied to your clipboard
(Sent data to Platform event happens) AND (XDM value productlistitems.0.sku = 1234)
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2025 Adobe. All rights reserved.