Adobe Experience Platform · updated
Consent with the Adobe Web SDK: defaultConsent and setConsent
The Web SDK has two consent controls. defaultConsent, set in the configure command, says what to do before the visitor has chosen: in, out or pending. The setConsent command records the visitor's choice. With pending, events are held in memory and no ECID or cookie is created until consent is given. Adobe's current Web SDK consent is all or nothing, not per purpose.
In plain words
Where the law requires permission before collecting data, the page must stay quiet until the visitor agrees. The Web SDK can wait: it holds what it would have sent, and sends it only after your cookie banner tells it the visitor said yes. If the visitor says no, the held data is thrown away. Your consent banner and the Web SDK are separate things that your code must connect.
defaultConsent
| Value | What Adobe says happens |
|---|---|
| in | Data collection operates normally until the user opts out. This is the default if you set nothing. |
| pending | Data is stored locally until the user opts in using the setConsent command. |
| out | Data is permanently discarded until the user opts in. |
The value is case sensitive, and any other value makes the library throw an error. It does not persist between page loads, so set it on every configure call. The visitor's resolved choice does persist, in a cookie.
How the two controls combine
| defaultConsent | setConsent | Data collected | Cookies set | Identity |
|---|---|---|---|---|
| in | Not set | Yes | Yes | An ECID is generated on the first request |
| in | out | No | Yes | Collection stops; the existing ECID and cookies stay until they expire |
| pending | Not set | No | No | No ECID; events are queued locally |
| pending | in | Yes | Yes | Queued events are sent; an ECID is generated |
| pending | out | No | Yes | Queued events are discarded; only the consent cookie is set |
| out | Not set | No | No | No ECID, no cookies, no events |
| out | in | Yes | Yes | An ECID is generated on the first request |
Adobe notes that a consent cookie is set even when a visitor opts out, because it is needed to honour that choice. Events queued while consent is pending are held in memory and do not survive a page reload.
setConsent standards
| Standard | Shape of the value |
|---|---|
| Adobe 2.0 | standard "Adobe", version "2.0", value.collect.val "y" or "n", and value.metadata.time |
| Adobe 1.0 | standard "Adobe", version "1.0", value.general "in" or "out" |
| IAB TCF 2.0 | standard "IAB TCF", version "2.0", value set to the consent string, plus gdprApplies |
More than one standard can be sent in one call. The SDK writes the choice to a cookie named kndctr_<orgId>_consent. Adobe says the Web SDK offers no way to retrieve consent, recommends storing the banner's preferences separately, and notes that you can call setConsent on every page load because a server call is made only when consent changes.
Pitfalls Adobe describes
- Some consent managers clear all cookies, including the kndctr_ identity cookies, when they show the banner. The visitor then gets a new ECID and looks like a new person. Adobe says to exclude kndctr_ cookies from clearing.
- With the IAB TCF standard, the SDK does not add consent information to events automatically; you add it to the event's XDM yourself and the schemas need the IAB consent field groups.
- A first-party device ID cookie is set by your own server and is not held back by the SDK's consent state. If nothing may be set before consent, delay it yourself.
This page explains what the code does. It is not legal advice. Which default is right for your visitors is a decision for your privacy or legal team.
Opt-in pattern: wait for consent (placeholders, not real IDs)
alloy("configure", {
datastreamId: "YOUR_DATASTREAM_ID",
orgId: "YOUR_ORG_ID@AdobeOrg",
defaultConsent: "pending"
});
// When the visitor grants consent:
alloy("setConsent", {
consent: [{
standard: "Adobe",
version: "2.0",
value: {
collect: { val: "y" }
}
}]
});Choosing the default from the consent manager's gdprApplies flag, as Adobe's defaultConsent page shows
var alloyConfiguration = { ... };
window.__tcfapi('getTCData', 2, function (tcData, success) {
if (success) {
alloyConfiguration.defaultConsent = tcData.gdprApplies ? "pending" : "in";
window.alloy("configure", alloyConfiguration);
}
});How to wire consent
- Agree the default with your privacy team: pending where consent is needed first, in where collection is allowed by default.
- Set defaultConsent in the configure command on every page.
- In your consent manager's callback, call setConsent with the visitor's choice in the standard you use.
- Tell the consent manager not to clear kndctr_ cookies before the visitor has chosen.
- Test all three paths in a clean browser: no choice, accept, and reject. Watch the network panel for requests to the Edge Network.
- Remember that the page code only shows order and settings; what is really sent before a choice needs a real browser test.
Related tools and pages on this site
- Web SDK snippet builder (free, runs in your browser)
- Adobe tag, Web SDK and consent scan (reads a live site's page code)
Questions
Can the Web SDK ask for consent per purpose?
Not today. Adobe says the current implementation is an all-or-nothing approach to opt-in, and that it plans a fuller set of purposes.
Do I call setConsent on every page?
You do not have to: the choice is stored in a cookie and applied on later page loads. Adobe says you can call it on every page load to stay in sync, and a server call is made only when consent changes.
What happens to events while consent is pending?
They are held in memory. Adobe says they do not survive a page reload, so events from a page the visitor leaves before choosing are lost.
Can your tag scan tell me whether data is sent before consent?
No. The scan reads page code, so it can show a defaultConsent setting and whether Adobe libraries come before the consent manager. What is actually sent before a visitor chooses needs a real browser.
Sources
- Adobe: defaultConsent (Web SDK configure command) (checked 13 Nov 2026)
- Adobe: setConsent (Web SDK command) (checked 13 Nov 2026)
- Adobe: Consent and identity in Data Collection (the defaultConsent and setConsent table) (checked 13 Nov 2026)
- Adobe: Identity in Data Collection (ECID, first-party device IDs, first-party collection) (checked 13 Nov 2026)
Facts about Adobe's products on this page are from the linked Adobe pages, read on the date shown beside each. Explanations, steps and examples are ours unless marked as Adobe's. If Adobe's page and this one differ, Adobe's page is right.
Surge Migrate is not affiliated with Adobe and claims no Adobe partner status. Adobe product names are trademarks of Adobe.