Advanced architecture
Live event graph
A visit is a graph, not a list of totals. Pages are nodes and events are edges. Add a page view, a scroll, or a click and D3 redraws this visit. The drawing stays in the tab.
Understanding the labHow to use it and why you'd want to
Why you'd want to
You want the current visit as a map instead of a counter. Add a page or an event and D3 redraws it in this tab.
How to use it
- Start from this page as the first node.
- Add a scroll, a click, or another page.
- Read the event name on the edge.
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.
trailGraph turns the steps you add into unique page nodes and one edge per step after the first. The component draws that graph with D3. It does not post the trail.
Start with this page
The first step is a page_view on this lab. It becomes the first node and has no incoming edge.
Append an event
A scroll or a click pushes another step. A repeated page still adds an edge.
Draw with D3
d3-scale places the nodes and d3-selection paints circles and paths into the svg.
From the code
Edges follow the previous step.
edges.push({ from: previous.page, to: step.page, event: step.event })D3 clears the svg and draws the current trail.
select(node).selectAll("*").remove()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: "live_event_graph_example",
lab_id: "live-event-graph",
})Example implementation. This site does not call Adobe. eVar167, prop167, and event167 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 eVar167 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: {
graphStayedLocal: "true",
},
},
})Example hit. eVar167 is hit-scoped in this example.
s.eVar167 = "true"
s.prop167 = "true"
s.events = "event167"
s.tl(true, "o", "live-event-graph_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…