applyResponse
The applyResponse
command allows you to perform various actions based on a response from the Edge Network. It is typically used in hybrid deployments where the server makes an initial call to the Edge Network. This command takes the response from that call and initializes the Web SDK in the browser.
Applying responses is performed as an action within a rule in the Adobe Experience Platform Data Collection tags interface.
Run the applyResponse
command when calling your configured instance of the Web SDK. The object containing configuration options supports the following fields:
renderDecisions
: A boolean that forces the Web SDK to render any personalized content that is eligible for automatic rendering. Identical to renderDecisions
in the sendEvent
command.responseHeaders
: A map of string header names to string header values.responseBody
: Required. A JSON response body from the server call to the Edge Network.personalization.sendDisplayEvent
: A boolean that operates identically to personalization.sendDisplayEvent
in the sendEvent
command.alloy("applyResponse",{
"renderDecisions": true,
"responseHeaders": {},
"responseBody": {},
"personalization": {
"sendDisplayEvent": true
}
});
If you decide to handle responses with this command, the following properties are available in the response object:
propositions
: An array of propositions returned by the Edge Network. Propositions that are automatically rendered include the flag renderAttempted
set to true
.inferences
: An array of inference objects, which contain machine learning information about this user.destinations
: An array of destination objects returned by the Edge Network.