adobe.target.applyOffer(options)
Last update: July 17, 2023
- Topics:
- at.js
CREATED FOR:
- Developer
This function is for applying the response content with Adobe Target.
applyOffer
requires the mbox
parameter. If no mbox name is specified, an error occurs.The options parameter is mandatory and has the following structure:
Key | Type | Required | Description |
---|---|---|---|
mbox | String | Yes | Mbox name With at.js 1.3.0 (and later) Target enforces that the mbox key is used. This key has been required in the past, but Target now enforces its use to ensure that Target has proper validation and customers are using the function correctly. |
selector | String or DOM Element | No | HTML element or CSS selector used to identify the HTML element where Target should place the offer content. If selector is not provided, Target assumes that the HTML element should use HTML HEAD. |
Offer | Array | Yes | An array actions that should be applied to the element. |
Example
The following example shows how to use getOffer
and applyOffer
together:
adobe.target.getOffer({
"mbox": "mbox",
"success": function(offers) {
adobe.target.applyOffer( {
"mbox": "mbox",
"offer": offers
} );
},
"error": function(status, error) {
if (console && console.log) {
console.log(status);
console.log(error);
}
},
"timeout": 5000
});
Previous pageadobe.target.getOffers() - at.js 2.x
Next pageadobe.target.applyOffers() - at.js 2.x
Target
- Adobe Target Developer Guide
- Getting started
- Before you implement
- Privacy and security
- Privacy overview
- Privacy and data protection regulations
- Target cookies
- Delete the Target cookie
- The impact of third-party cookie deprecation on Target (at.js)
- Google Chrome SameSite cookie policies
- Apple Intelligent Tracking Prevention (ITP) 2.x
- Content Security Policy (CSP) directives
- Allowlist Target edge nodes
- Methods to get data into Target
- Target security overview
- Supported browsers
- TLS (Transport Layer Security) encryption changes
- CNAME and Adobe Target
- Client-side implementation
- Overview: implement Target for client-side web
- Adobe Experience Platform Web SDK implementation overview
- at.js implementation
- at.js overview
- How at.js works
- How to deploy at.js
- On-device decisioning
- at.js functions
- at.js functions overview
- adobe.target.getOffer()
- adobe.target.getOffers() - at.js 2.x
- adobe.target.applyOffer()
- adobe.target.applyOffers() - at.js 2.x
- adobe.target.triggerView() - at.js 2.x
- adobe.target.trackEvent()
- mboxCreate() - at.js 1.x
- targetGlobalSettings()
- mboxDefine() and mboxUpdate() - at.js 1.x
- targetPageParams()
- targetPageParamsAll()
- registerExtension() - at.js 1.x
- sendNotifications() - at.js 2.1
- at.js custom events
- Debug at.js using the Adobe Experience Cloud Debugger
- Use cloud-based instances with Target
- at.js FAQs
- at.js version details
- Upgrading from at.js 1.x to at.js 2.x
- at.js cookies
- User-agent and client hints
- Understand the Global mbox
- Server Side implementation
- Server Side: implement Target overview
- Getting started with Target SDKs
- Sample apps
- Transition from Target legacy APIs to Adobe I/O
- Core principles
- Integration
- On-Device Decisioning
- Node.js SDK Reference
- Java SDK Reference
- .NET SDK Reference
- Python SDK Reference
- Hybrid implementation
- Recommendations implementation
- Mobile app implementation
- Email implementation
- API guides
- Implementation patterns