Session
{
  "id": "session-0042",
  "timestamp": "2024-01-01T12:00:00Z",
  "source": "organic"
} On this page
Analytics Lab / Instrumentation
Prototype a normalized event model that can power any analytics or marketing endpoint. Engage with
        the controls to observe the structured payloads delivered to window.dataLayer.
Session, user, and page objects are seeded once per visit. Every interaction extends this payload so downstream tags inherit a shared vocabulary.
{
  "id": "session-0042",
  "timestamp": "2024-01-01T12:00:00Z",
  "source": "organic"
} {
  "auth_state": "anonymous",
  "persona": "analyst",
  "account_tier": "explorer"
} {
  "template": "lab-sandbox",
  "section": "analytics",
  "language": "en-US"
} Buttons, links, and forms declare their instrumentation through data attributes. A helper maps the DOM metadata into normalized payloads pushed into the data layer.
Hero CTAs, navigation links, and internal search queries.
Video milestones and download tracking for resource hubs.
Add to cart through purchase confirmation using shared product IDs.
Feedback loops that monitor quality, consent, and reliability.
Initialize the data layer early and push the session, user, and page context before registering interaction handlers.
<script>
  window.dataLayer = window.dataLayer || [];
  window.dataLayer.push({
    schema: 'unified-data-layer/v2',
    session: {/* ... */},
    user: {/* ... */},
    page: {/* ... */}
  });
</script>