Simulation
Next best action
One action for this session: a guide, a lab, a consult nudge, or nothing. Frequency caps and a rushed visit hold it back.
Understanding the labHow to use it and why you'd want to
Why you'd want to
One guide, lab, or contact link is picked from labs already viewed. The offer is held when consent is off, the visit is rushed, or that action was shown twice.
How to use it
- Consent off or a rushed visit holds the offer.
- The pick is one action, from labs already viewed.
- A second showing is the cap. The third does not appear.
- After Accept, lab_interaction is queued for that action.
Simulation. One action for this view. A cap of two showings, or a rushed visit, holds it back. No model call.
This session
The one action
Dwell: missing.
Show nothing
consent
Showings stored: guide 0, lab 0, consult 0. Cap 2.
Why am I seeing this? Consent off, an explicit rushed switch, or dwell under 15 seconds means nothing is offered. Otherwise one guide, lab, or contact link is chosen from labs already viewed. After 2 showings that action is held. Counts are stored only with measurement consent. Missing dwell is not treated as rushed.
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
The next-best-action lab picks one guide, lab, or contact link from labs already viewed, and it holds that offer when consent is off, the visit is rushed, or the action was shown twice. After Accept it queues lab_interaction, and it does not call Adobe.
Refuse consent off and a rush
chooseAction returns nothing when consent is off. It also returns nothing when the rushed switch is on, or when dwellSeconds is present and under 15. A missing dwell is not treated as rushed.
Pick one action
A personalization lab already viewed selects consult. Otherwise a measurement lab selects lab. Otherwise the action is guide.
Stop at two showings
If that action has already been counted twice, chooseAction returns nothing with reason cap. I saw this increments the count and writes it only when measurement consent is on.
Queue lab_interaction
useLabView queues lab_interaction with action view and label page, once, after Accept. The rushed switch and I saw this call trackLab, which queues the same event with action run_demo.
From the code
Consent, a rush, and a cap of two all return nothing. Otherwise one action is chosen.
export function chooseAction(input: {
consent: boolean
rushed: boolean
dwellSeconds: number | null
measurementLabs: number
personalizationLabs: number
shown: Shown
}): { action: NbaAction; reason: "consent" | "rushed" | "cap" | "guide" | "lab" | "consult" } {
if (!input.consent) return { action: "nothing", reason: "consent" }
if (input.rushed || (input.dwellSeconds !== null && input.dwellSeconds < RUSH_SECONDS)) return { action: "nothing", reason: "rushed" }
const action: Exclude<NbaAction, "nothing"> = input.personalizationLabs > 0 ? "consult" : input.measurementLabs > 0 ? "lab" : "guide"
if (input.shown[action] >= NBA_CAP) return { action: "nothing", reason: "cap" }
return { action, reason: action }
}The page passes dwell and labs already viewed, then records a showing.
const [rushed, setRushed] = useState(false)
const signals = ready ? decision?.signals : null
const labs = signals ? (consent === "granted" ? signals.knownPages : signals.pagesViewed) : null
const dwell = signals ? signals.dwellSeconds : null
const choice = chooseAction({
consent: consent === "granted",
rushed,
dwellSeconds: dwell,
measurementLabs: labs?.filter((path) => MEASUREMENT.includes(path)).length ?? 0,
personalizationLabs: labs?.filter((path) => PERSONAL.includes(path)).length ?? 0,
shown,
})
function sawIt() {
if (choice.action === "nothing") return
const next = { ...shown, [choice.action]: shown[choice.action] + 1 }
writeShown(next)
trackLab(LAB, `seen-${choice.action}`)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. The rushed switch and I saw this send action run_demo, with a label such as rushed-on or seen-guide. The chosen link and the dwell seconds are not parameters. 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: "next-best-action",
action: "view",
label: "page",
})Example implementation. This site does not call Adobe. eVar86, prop86, and event86 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 eVar86 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: {
nextAction: "guide",
},
},
})Example hit. eVar86 is hit-scoped in this example. prop86 dies at the same hit.
s.eVar86 = "guide"
s.prop86 = "guide"
s.events = "event86"
s.linkTrackVars = "eVar86,prop86,events"
s.linkTrackEvents = "event86"
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 next-best-action.
Adobe. Example eVar86, expire on the hit.
Scope. Event. A user property would stick this lab onto later hits.
Action
GA4. Parameter action. view when the page opens. run_demo when a control is used.
Adobe. Example prop86, which dies at the hit.
Scope. Event.
Label
GA4. Parameter label. page on the view. rushed-on, rushed-off, or seen-guide on a demo.
Adobe. Example eVar86 if you stored the label instead of the lab id.
Scope. Event. The label names this click, not the visit.
Chosen offer
GA4. Not sent. guide, lab, consult, and nothing stay on the page.
Adobe. Example prop86 if you tracked the offer. The page does not.
Scope. Hit, if you sent it. A user property would keep an offer after the cap.
Recommended next
Why these picksReading path transitions…