Event API Responses
Requests sent to the Event API return JSON that contains information about any campaigns that are returned. A response from the Event API has the following shape.
campaignResponses: CampaignResponse[]
An array of all campaigns returned in the event. For more information, see CampaignResponse Object.
compiledCampaignTemplates: CompiledCampaignTemplate[]
An array of all campaign templates returned in the event. For more information, see CampaignExplanations Object.
errorCode: number
The error code. Possible values are:
errorCode | Description |
---|---|
0 | Success |
1 | Missing Encrypted UserId Parameter |
2 | Invalid Encrypted UserId Parameter |
3 | Busy |
4 | Anonymous ID Correction |
5 | Invalid Event |
resolvedUserId: string
The primaryId of the resolved User. The primaryId is only returned if the Pipeline Identity Resolution feature is enabled for the tenant. See User Identity Mapping for more information.
persistedUserId: object
An object containing the encrypted user id of the user. This object is only returned if the Pipeline Identity Resolution feature is not enabled for the tenant and a primary user id is specified in the event. See Identity for more information.
eventDetails: eventDetails
An object containing the event received by the server. This object is only returned if debug.explanations
was sent with the event and the event was authenticated.
Data associated with the campaigns returned from an event.
type: string
The type of campaign returned. The value of type
is "c"
for server-side campaigns and "ng"
for web campaigns.
campaignId: string
The id of the campaign returned.
campaignName: string
The name of the campaign returned.
campaignType: string
The type of the campaign returned. The value of campaignType
is "ServerSide"
for server-side campaigns and "Web"
for web campaigns.
experienceId: string
The id of the experience returned.
experienceName: string
The name of the experience returned.
state: string
The state of the campaign returned. The value of state
can be "Published"
, "Disabled"
, or "Testing"
depending on the campaign state.
displayMode: string
Deprecated. This object is only returned for server-side campaigns and its value is always "Personalized"
.
redirectUrl: null
Deprecated. This object is only returned for server-side campaigns.
saveParameters: boolean
Deprecated. This object is only returned for server-side campaigns and is always set to false
.
hidePageBeforeRedirect: boolean
Deprecated. This object is only returned for server-side campaigns and is always set to false
.
campaignJavascriptContent: null
Deprecated. The campaignJavascriptContent
object is always set to null
.
javascriptContent: null
Deprecated. This object is only returned for server-side campaigns and is always set to null
.
userGroup: string
The user group of the campaign experience returned. The userGroup
can either be "Default"
or "Control"
.
googleAnalyticsConfig: null
Deprecated. This object is only returned for server-side campaigns and is always set to null
.
messages: []
Deprecated. This object is only returned for server-side campaigns and is always set to []
.
pageChanges: []
Deprecated. This object is only returned for server-side campaigns and is always set to []
.
templateNames: string[]
An array of the template names used in the experience. This object is only returned for web campaigns.
serverSideMessages: ServerSideMessage[]
An array of messages returned for a server-side campaign. This object is only returned for server-side campaigns. The event must be sent with source.channel
set to "Server"
in order to return serverSideMessages
. For more information, see ServerSideMessage object.
payload: payload
The payload object returned by the campaign. For more information, see Template Server Typescript.
Data associated with serverSideMessages
returned in a campaignResponse
For server-side campaigns, an array of ServerSideMessage
objects is returned that contains information about the data returned for the server-side campaign message. The event must be sent with source.channel
set to "Server"
in order to return serverSideMessages
. See Server-Side Campaigns for more information on configuring server-side Campaigns.
type: string
The type of message returned. For a ServerSideMessage, the type
is always "evg_md"
.
id: string
The id of the message returned.
data: string
Deprecated. Its value is always "{}"
.
targetName: string
The name of the target for the ServerSideMessage.
containsDynamicContent: boolean
True if the message contains any dynamic content. False if the message does not contain dynamic content.
promotedItemKeys: PromotedItem[] | null
If the message contains promoted items, promotedItemKeys
is an array of promoted items. Otherwise its value is null. Each PromotedItem returned contains the type of the item returned and the _id of the item returned. Example:
campaignState: string
The state of the campaign returned. Depending on the state of the campaign, the value of campaignState
can be "Published"
, "Disabled"
, or "Testing"
.
dataMap: dataMap
An object containing the key value pairs defined in the campaign. For example:
For keys with type "Promoted Content", the full value of each item is returned unless the "Item IDs only" option is enabled in the message settings. See Server-Side Campaigns for more information on configuring server-side campaigns and the returned dataMap
object.
Data associated with campaignTemplates
returned in an event
An event response returns an array of any compiledCampaignTemplates
used in a campaignResponse
. The compiledCampaignTemplates
object contains information about the campaign templates.
id: string
The id of the template.
name: string | null
The name of the template.
bundle: string
The stringified client-side code used to render the template.
Data associated with campaignExplanations
returned in an event.
campaignExplanations
returns in an event only if debug.explanations
is true
in the event payload. It contains additional information about why campaigns did or did not return in the event response. It is only returned if the event request is authenticated.
class: string
Information of the type of explanation returned.
campaignId: string
The id of the campaign the explanation is for.
campaignName: string
The name of the campaign the explanation is for.
experienceId: string
The id of the experience the explanation is for.
experienceName: string
The name of the experience the explanation is for.
messageId: string
The id of the message the explanation is for.
explanationMessage: string
A message containing the reason the campaign was not returned in the response.
context: string
A string containing the campaign name, campaign id, experience name, and experience id for the message not returned in the response.