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

ValueWhat Adobe says happens
inData collection operates normally until the user opts out. This is the default if you set nothing.
pendingData is stored locally until the user opts in using the setConsent command.
outData 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

defaultConsentsetConsentData collectedCookies setIdentity
inNot setYesYesAn ECID is generated on the first request
inoutNoYesCollection stops; the existing ECID and cookies stay until they expire
pendingNot setNoNoNo ECID; events are queued locally
pendinginYesYesQueued events are sent; an ECID is generated
pendingoutNoYesQueued events are discarded; only the consent cookie is set
outNot setNoNoNo ECID, no cookies, no events
outinYesYesAn 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

StandardShape of the value
Adobe 2.0standard "Adobe", version "2.0", value.collect.val "y" or "n", and value.metadata.time
Adobe 1.0standard "Adobe", version "1.0", value.general "in" or "out"
IAB TCF 2.0standard "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

  1. Agree the default with your privacy team: pending where consent is needed first, in where collection is allowed by default.
  2. Set defaultConsent in the configure command on every page.
  3. In your consent manager's callback, call setConsent with the visitor's choice in the standard you use.
  4. Tell the consent manager not to clear kndctr_ cookies before the visitor has chosen.
  5. Test all three paths in a clean browser: no choice, accept, and reject. Watch the network panel for requests to the Edge Network.
  6. 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

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

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.

Surge Migrate

Moving the website itself

This page answers one Adobe Experience Platform question. Surge Migrate moves a website from any CMS to any CMS. Converted automatically. Checked before you install.

  1. 1

    Scan

    Names the system behind your site, counts pages and templates, lists the blocks to build and the work no tool does, and gives an effort range with its working.

    Scan a site →
  2. 2

    Convert

    Each page becomes an Edge Delivery document, an AEM Core Component page and import files for 7 other systems. 10 pages free; 500 or 2,000 pages in one paid run.

    Convert your pages →
  3. 3

    Verify

    A download is offered only when its own format check passes. The report lists every field not found and every component kept as plain content. Compare old and new pages side by side.

    Parity check →
  4. 4

    Install

    You import with the target system's own tool, on your own environment. Each download's README gives the command. Your system changes only when you run it.

    How each import was tested →