Simulation
Privacy negotiator
Each consent level shows what an agent would and would not do. The location trade is reversible.
Understanding the labHow to use it and why you'd want to
Why you'd want to
Measurement, personalization, and a location trade become a list of what an agent may do. Sensitive categories and identity stay off, and after Accept the choice can be stored.
How to use it
- Change a trade and watch the allowed list rewrite.
- Sensitive categories and identity are not offered.
- The choice is stored only after Accept.
- After Accept, lab_interaction is queued for that choice.
Simulation. These switches are the negotiation. Turning one off removes that permission immediately. No model call.
Consent
What the agent may do
Not stored. Measurement consent is off, so this choice stays in memory.
Read this screen size for layout
Would do · ephemeral
Remember labs and visit count
Would not · consent-off
Reorder suggested pages
Would not · needs-personalization
Use a coarse place for local examples
Would not · location-off
Infer health, religion, politics, or finances
Would not · never
Keep a name or email from this lab
Would not · never
Why am I seeing this? Off blocks stored history and reordering. Measurement allows stored visits. Personalization allows reordering. Local examples need the extra location trade. Sensitive categories and identity stay off. The choice is written to this browser only when measurement consent is on. Reset my data clears it.
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
The privacy lab turns measurement, personalization, and a location trade into a list of what an agent may do, and it keeps sensitive categories and identity off. After Accept it queues lab_interaction, and it does not call Adobe.
Normalize the choice
normalizeChoice forces location off unless the level is personalization. Off and measurement cannot keep the location trade.
List the trades
trades always allows an ephemeral screen. Visits require a level other than off. Reordering requires personalization. Local examples require the location trade. Sensitive categories and identity stay false.
Store the choice with consent
The choice is written to localStorage only when measurement consent is on and Global Privacy Control is absent. Otherwise the write is skipped and the cached choice is cleared.
Queue lab_interaction
useLabView queues lab_interaction with action view and label page after Accept. Changing the level or the location switch calls trackLab, which queues action run_demo.
From the code
Six trades. Sensitive categories and identity are never allowed.
export function trades(choice: PrivacyChoice): Trade[] {
const level = choice.level
const location = choice.level === "personalization" && choice.location
return [
{ id: "screen", allow: true, because: "ephemeral" },
{ id: "visits", allow: level !== "off", because: level === "off" ? "consent-off" : "measurement" },
{ id: "reorder", allow: level === "personalization", because: level === "personalization" ? "personalization" : "needs-personalization" },
{ id: "local-examples", allow: location, because: location ? "location-trade" : "location-off" },
{ id: "sensitive", allow: false, because: "never" },
{ id: "identity", allow: false, because: "never" },
]
}The switches write the choice and queue lab_interaction.
export function PrivacyLab() {
const locale = useLocale()
const { consent } = useConsent()
useLabView(LAB)
const choice = useSyncExternalStore(subscribe, readChoice, () => EMPTY)
const rows = trades(choice)
function setLevel(level: PrivacyLevel) {
writeChoice({ level, location: choice.location })
trackLab(LAB, `level-${level}`)
}
function setLocation(location: boolean) {
writeChoice({ level: "personalization", location })
trackLab(LAB, location ? "location-on" : "location-off")
}Google and Adobe
Google queues lab_interaction after Accept. Adobe is an example of the same fields.
lab_interaction is queued only after Accept. Opening the lab sends action view and label page. A level change sends action run_demo and a label such as level-measurement, location-on, or location-off. The trade list is not a parameter. Register lab_id, action, and label as event-scoped custom dimensions. This site does not call Adobe.
Simplified shape of the object queued after Accept. Register any new parameter as an event-scoped custom dimension. This site does not call gtag('set').
dataLayer.push({
event: "lab_interaction",
lab_id: "privacy-negotiator",
action: "view",
label: "page",
})Example implementation. This site does not call Adobe. eVar92, prop92, and event92 are example variable numbers. In Launch, a data element reads the value and a rule sends it when the value changes. In the report suite, enable eVar92 with Most Recent allocation and expire it on the hit. A processing rule is unnecessary if the data element maps straight to that eVar.
Example alloy payload. _example is a placeholder schema, not a real tenant.
alloy("sendEvent", {
xdm: {
eventType: "web.webinteraction.linkClicks",
_example: {
privacyLevel: "measurement",
},
},
})Example hit. eVar92 is hit-scoped in this example. prop92 dies at the same hit.
s.eVar92 = "measurement"
s.prop92 = "measurement"
s.events = "event92"
s.linkTrackVars = "eVar92,prop92,events"
s.linkTrackEvents = "event92"
s.tl(true, "o", "lab_interaction")Translation
Each lab field, the GA4 name, and the example Adobe variable. Scope is the part that usually gets lost in the translation.
Lab id
GA4. Parameter lab_id on lab_interaction. The value is privacy-negotiator.
Adobe. Example eVar92, expire on the hit.
Scope. Event.
Action
GA4. Parameter action. view or run_demo.
Adobe. Example prop92, which dies at the hit.
Scope. Event. It names this interaction, not the user.
Label
GA4. Parameter label. page, level-off, level-measurement, level-personalization, location-on, or location-off.
Adobe. Example eVar92 if you stored the label instead of the lab id.
Scope. Event.
Trade list
GA4. Not sent. Allow and deny stay on the page.
Adobe. Example prop92 if you tracked one trade. The page does not.
Scope. Hit, if you sent it. A user property would keep a permission after the switch moves.
Recommended next
Why these picksReading path transitions…