Advanced architecture
Predictive intent
A page can react before a click. Scroll this lab and wait. Two scores update from scroll depth, dwell, and how many steps you add. The note changes when one score leads. The math stays in the tab.
The weights are fixed in the page. A trained model and a decision service are not called.
Understanding the labHow to use it and why you'd want to
Why you'd want to
You want the page to react to this visit before a click. Scroll, wait, or add a step, and the note follows the higher score.
How to use it
- Scroll the page and watch both scores.
- Add a step to raise the path depth.
- Read the note that the page is showing.
Loading the lab…
WalkthroughHow we built itShowHide
Example vendor setup is marked below. eVar and event numbers are examples. This lab does not call Adobe.
intentScores runs two sigmoids on scroll, dwell, and path depth. The component listens to scroll and a timer, then swaps the note when one score leads. The scores are not posted.
Read this page only
Scroll is the fraction of this document. Dwell is seconds since the lab mounted. Path depth is the steps you add.
Score leave and packages
A low scroll and a short dwell raise leave. A deep scroll, a long dwell, and three steps raise packages.
Change the note
The visible sentence follows whichever score is higher once it passes 0.55.
From the code
Two scores from the same three inputs.
const leave = sigmoid(-1.1 + 2.3 * (1 - scroll) + (input.dwellSeconds < 8 ? 1.05 : -0.4) + (input.pathDepth < 2 ? 0.45 : -0.2))The listener is removed when the lab unmounts.
window.addEventListener("scroll", onScroll, { passive: true })Google and Adobe
This lab does not queue its own event. The Google block is an example. Adobe is an example too.
This lab does not queue an analytics event of its own. The push below is an example, not a call this page makes. This site does not call Adobe.
Example only. This page does not push this object.
// Example only. This lab does not queue this event.
dataLayer.push({
event: "predictive_intent_example",
lab_id: "predictive-intent",
})Example implementation. This site does not call Adobe. eVar171, prop171, and event171 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 eVar171 with Most Recent allocation and expire it on the hit.
Example alloy payload. _example is a placeholder schema, not a real tenant.
alloy("sendEvent", {
xdm: {
eventType: "web.webinteraction.linkClicks",
_example: {
intentStayedLocal: "true",
},
},
})Example hit. eVar171 is hit-scoped in this example.
s.eVar171 = "true"
s.prop171 = "true"
s.events = "event171"
s.tl(true, "o", "predictive-intent_example")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 advanced_lab_view.
Adobe. Example eVar, expire on the hit.
Scope. Event. It names this lab, not the user.
Demo value
GA4. Not sent. Scores, proofs, and payloads stay on the page.
Adobe. Example prop. Do not copy the demo value.
Scope. Local state. It is not a user property.
Example counts
GA4. Not sent. Labeled example data is not a metric.
Adobe. Example event. Not sent.
Scope. A figure on the page, not a hit.
Consent
GA4. The view event is skipped until Accept.
Adobe. Example: skip the hit while consent is off.
Scope. A gate on the hit.
Recommended next
Why these picksReading path transitions…