Edit in GitHubLog an issue

Get Offers


getOffers() is used to execute a decision and retrieve an experience from Adobe Target.


Copied to your clipboard
TargetClient.getOffers(options: Object): Promise


The options object has the following structure:

RequestObjectYesNoneConforms to the Target Delivery API request
visitorCookieStringNoNoneECID (VisitorId) cookie
targetCookieStringNoNoneTarget cookie
targetLocationHintStringNoNoneTarget location hint
consumerIdStingNoNoneconsumerIds for Analytics for Target (A4T) stitching
CustomerIdsArrayNoNoneCustomer IDs in VisitorId-compatible format
sessionIdStringNoNoneUsed for linking multiple Target requests
visitorObjectNonew VisitorIdSupply an external VisitorId instance


Promise returned has the following structure:

requestObjectTarget Delivery API request
responseObjectTarget Delivery API response
visitorStateObjectObject that should be passed to Visitor API getInstance()
targetCookieObjectTarget cookie
targetLocationHintCookieObjectTarget location hint cookie
analyticsDetailsArrayAnalytics payload, in case of client-side Analytics usage
responseTokensArrayA list of Response tokens.
traceArrayAggregated trace data for all request mboxes/views
statusObjectAn object containing the status of the response.
decisioningMethodStringDetermines which decisioning method to use (on-device, server-side, hybrid)

targetCookie and targetLocationHintCookie objects used for passing data back to the browser have the following structure:

nameStringCookie name
valueAnyCookie value, the will be converted to string
maxAgeNumberThe maxAge option is a convenience for setting expires relative to the current time in seconds

The status object used for indicating the status of the target response has the following structure:

statusNumberHTTP status code
messageStringA message about the response. For instance, it may indicate if the response was decided on-device or server-side
remoteMboxesArrayWhen decisioning Method is on-device, an array of mbox names that could not be fully decided on-device is given. In other words, a Target Delivery API request is needed.


Copied to your clipboard
1const TargetClient = require("@adobe/target-nodejs-sdk");
2const CONFIG = {
3 client: "acmeclient",
4 organizationId: "1234567890@AdobeOrg"
7const targetClient = TargetClient.create(CONFIG);
9const request = {
10 context: {channel: "web"},
11 execute: {
12 mboxes: [{
13 name: "a1-serverside-ab",
14 index: 1
15 }]
18const response = await targetClient.getOffers({ request });
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.