Edit in GitHubLog an issue

Get Offers

Description#

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

Method#

TargetClient.GetOffers method signature.

Copied to your clipboard
TargetDeliveryResponse TargetClient.GetOffers(TargetDeliveryRequest request)

TargetDeliveryRequest is created using TargetDeliveryRequest.Builder.

Copied to your clipboard
TargetDeliveryRequest.Builder TargetDeliveryRequest.Builder()

Parameters#

The TargetDeliveryRequest.Builder object has the following structure:

NameTypeRequiredDescription
contextContextYesSpecifies the context for the request
sessionIdStringNoUsed for linking multiple Target requests
thirdPartyIdStringNoYour company’s identifier for the user that you can send with every call
cookiesListNoList of cookies returned in previous Target request of same user.
customerIdsMapNoCustomer Ids in VisitorId-compatible format
executeExecuteRequestNoPageLoad or mboxes request to execute. Will be evaluated on server side immediately
prefetchPrefetchRequestNoViews, PageLoad or mboxes request to prefetch. Returns with notification token to be returned on conversion.
notificationsListNoUsed to sent notifications regarding what prefetched content was displayed
requestIdStringNoThe request ID that will be returned in the response. Generated automatically if not present.
impressionIdStringNoIf present, second and subsequent requests with the same id will not increment impressions to activities/metrics. Generated automatically if not present.
environmentIdLongNoValid client environment id. If not specified host will be determined base on the provided host.
propertyPropertyNoSpecifies the at_property via the token field. It can be used to control the scope for the delivery.
traceTraceNoEnables trace for Delivery API.
qaModeQAModeNoUse this object to enable the QA mode in the request.
locationHintStringNoTarget edge cluster location hint. Used to target given edge cluster for this request.
visitorVisitorNoUsed to provide custom Visitor API object.
idVisitorIdNoObject that contains the identifiers for the visitor. Eg. tntId, thirdParyId, mcId, customerIds.
experienceCloudExperienceCloudNoSpecifies integrations with Audience Manager and Analytics. Automatically populated using cookies, if not provided.
tntIdStringNoPrimary identifier in Target for a user. Fetched from targetCookies. Auto-generated if not provided.
mcIdStringNoUsed to merge and share data between different Adobe solutions(ECID). Fetched from targetCookies. Auto-generated if not provided.
trackingServerStringNoThe Adobe Analytics Server in order for Adobe Target and Adobe Analytics to correctly stitch the data together.
trackingServerSecureStringNoThe Adobe Analytics Secure Server in order for Adobe Target and Adobe Analytics to correctly stitch the data together.
decisioningMethodDecisioningMethodNoCan be used to explicitly set ON_DEVICE or HYBRID decisioning method for on-device decisioning

The values of each field should conform to Target Delivery API request specification.

Response#

The TargetDeliveryResponse returned by TargetClient.GetOffers() has the following structure:

NameTypeDescription
RequestTargetDeliveryRequest​Target Delivery API request
ResponseDeliveryResponse​Target Delivery API* response
StatusHttpStatusCodeResponse HTTP status code
MessagestringResponse status message or error message
LocationsLocationsTarget location names, including global mbox name and mboxes/views for which only remote decisioning is available
GetCookiesDictionaryReturns a dictionary of session metadata for this user. This needs to be passed in next Target request for this user.
VisitorStateIDictionaryVisitor state to be set on client side for Visitor API Javascript library initialization

The TargetCookie object used for saving data for user session has the following structure:

NameTypeDescription
NamestringCookie name
ValuestringCookie value
MaxAgeintThe MaxAge option is a convenience for setting Expires relative to the current time in seconds

You don't have to worry about expiring the cookies. Target handles MaxAge inside the SDK.

Example#

Copied to your clipboard
1var targetClientConfig = new TargetClientConfig.Builder("acmeClient", "ABCDEF012345677890ABCDEF0@AdobeOrg")
2 .Build();
3
4var targetClient = TargetClient.Create(targetClientConfig);
5
6var mboxRequests = new List<MboxRequest> { new (index: 1, name: "a1-serverside-ab") };
7
8var targetDeliveryRequest = new TargetDeliveryRequest.Builder()
9 .SetExecute(new ExecuteRequest(mboxes: mboxRequests))
10 .Build();
11
12var targetResponse = targetClient.GetOffers(targetDeliveryRequest);
Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.