Skip to content

Consent

Consent in Junction is not an afterthought bolted onto an existing system. It’s a first-class state machine that controls event flow from the moment the collector initializes.

┌─────────┐
Initial → │ PENDING │ ← No explicit choice yet
└────┬────┘
┌──────────┴──────────┐
▼ ▼
┌───────────┐ ┌───────────┐
│ GRANTED │ │ DENIED │
└───────────┘ └───────────┘
│ │
└──────────┬──────────┘
Can change at any time
(user updates preferences)

Every consent category starts in a configurable default state (typically pending). Events are queued until consent resolves.

CategoryDescriptionExample Destinations
necessaryAlways allowedError tracking
analyticsSite usage analyticsAmplitude, GA4
marketingAdvertising and retargetingMeta Pixel, Google Ads
personalizationContent personalizationOptimizely, LaunchDarkly
socialSocial media featuresShare widgets

When consent is pending:

  1. Events are queued in memory (with configurable size limits)
  2. When consent resolves, queued events are replayed to permitted destinations
  3. User properties on queued events are updated (identity may have changed since queuing)
  4. Destinations receive an onConsent() callback to sync their own consent state
// From your CMP callback or consent banner
jct.consent({
analytics: "granted",
marketing: "denied",
personalization: "granted",
});

Each destination declares which consent categories it requires:

{
destination: ga4,
config: { measurementId: "G-XXXXXXXXXX" },
consent: ["analytics"], // requires analytics consent
}

A destination only receives events when all its required categories are granted (AND logic).

Junction respects Do Not Track and Global Privacy Control signals by default. When these signals are detected, marketing and analytics consent categories are automatically denied.