CMP sources
walkerOS provides ready-made source packages for popular Consent Management
Platforms. Each source listens for CMP events and automatically calls
elb('walker consent', state), with no manual event listener code needed.
| CMP | Package |
|---|---|
| CookieFirst | @walkeros/web-source-cmp-cookiefirst |
| CookiePro / OneTrust | @walkeros/web-source-cmp-cookiepro |
| Usercentrics | @walkeros/web-source-cmp-usercentrics |
Conditional activation with require
Some sources and destinations shouldn't act on lifecycle events right away.
They may depend on consent status being resolved first, or need information
provided by other sources (like session IDs). The require option solves this
by gating on() delivery (for sources) or initialization (for destinations)
until specific collector events have fired.
Add require to any source or destination config to gate it on the listed
events:
In this example the CMP source initializes immediately and fires
elb('walker consent', state) once the user makes a choice. That consent
event unblocks the session source, the dataLayer source, and the GA4
destination, all at once.
How require works
- Sources are registered immediately and their
Instance.init()runs eagerly after registration.requiredoes not block init — it gateson()delivery. Lifecycle events targeted at a source with unmetrequireare buffered inInstance.queueOn. - Destinations with
requireare held as pending during initialization until their listed events fire. - Each time a collector event fires (e.g.,
consent,session,user), the collector decrements the matching entry from every source's and destination'srequirelist, then activates anything whose list is empty. - Sources whose
requirejust emptied have their queued lifecycle events replayed viasource.on(type, data). Destinations whoserequirejust emptied initialize and receive all previously queued events, so no data is lost.
Key points
- CMP sources must not have
require: they need to fire consent immediately, so the collector should be able to callon('consent', …)on them right away - Accepted values: any collector event type, such as
"consent","session","user","run","config","globals", etc. - AND logic:
require: ["consent", "session"]waits for both events - Cascading: a CMP source fires
consent→ session source's require clears, its queuedon('consent', …)replays, it firessession→ a dataLayer source waiting for["session"]clears next
How CMP sources work
- Detecting if the CMP is already loaded and reading existing consent
- Listening for CMP-specific events on consent changes
- Mapping CMP categories to walkerOS consent groups via
categoryMap - Calling
elb('walker consent', state)with the mapped state
All CMP sources support explicitOnly (default: true) to filter out
implicit/default consent and only process active user choices.
For more details on how consent works in walkerOS, see the consent management guide.