How it works

When jvx.js loads on your site, Jourvex resolves the current visitor and reconstructs their evaluation state across previous sessions automatically.

The resolved state object is passed into the stateReady callback on page load. No manual requests or backend setup required.

The object reflects Jourvex's latest understanding of that visitor's evaluation journey, including intent classification, session continuity, behavioral signals, and conversion state.

The State API is designed for lightweight real-time branching directly in the browser. Most teams use it to adapt onboarding, personalize messaging, trigger internal workflows, or enrich downstream systems before conversion happens.

Basic usage

Register a callback using window.jourvex.on() to receive the state object once it resolves.

Add the queue stub before your Jourvex script so callbacks can register immediately during page initialization.

javascript
window.jourvex = window.jourvex || {
  _queue: [],

  on: function(event, cb) {
    this._queue.push({ event, cb });
  }
};

window.jourvex.on("stateReady", function(journey) {

  console.log(journey);

  // journey is the full evaluation state object
  // use any field to branch your experience

});

You can also access the latest resolved state at any time using window.jourvex.getState().

javascript
const journey = window.jourvex.getState();

if (journey) {
  console.log(journey.intent_state);
}

State object reference

Full schema returned by the State API.

State object
{
  "resolved": true,
  "journey_id": "cluster_8f2ab",
  "intent_state": "high",
  "intent_score": 82,
  "sessions": 6,
  "converted": false,
  "channel": "linkedin",
  "archetype": "high_intent_prepare",

  "signals": {
    "pricing_views": 3,
    "high_intent_hits": 7,
    "enterprise_hits": 1,
    "days_since_last_seen": 0
  }
}

Field reference

Field
Type
Description
resolved
boolean
Indicates whether this visitor was successfully matched to an existing evaluation journey.
journey_id
string
Unique identifier for the reconstructed evaluator journey. Use this when fetching the full journey from your backend through the Journey API.
intent_state
string
High-level evaluation classification. One of high, medium, or low.
intent_score
number
Numerical intent score from 0–100 derived from return behavior, evaluation depth, session continuity, and high-intent activity.
sessions
number
Total recorded sessions associated with this evaluator journey.
converted
boolean
Indicates whether a conversion event has already been detected for this visitor.
channel
string
Original acquisition or attribution channel associated with the journey.
archetype
string
Behavioral classification describing the evaluation pattern this visitor is showing.
signals.pricing_views
number
Total pricing page visits recorded across all sessions.
signals.high_intent_hits
number
Number of visits to high-intent evaluation pages such as pricing, docs, integrations, API, or enterprise flows.
signals.enterprise_hits
number
Number of enterprise-oriented interactions such as sales CTAs or enterprise pricing engagement.
signals.days_since_last_seen
number
Days since the visitor's most recent recorded session.

Branching on evaluation state

The state object is designed for direct frontend branching. Most teams use it to adapt onboarding flows, swap CTAs, trigger internal routing, or personalize experiences based on live evaluator state.

javascript
window.jourvex.on("stateReady", function(journey) {

  // High intent evaluator

  if (journey.intent_state === "high" && !journey.converted) {

    const cta = document.getElementById("primary-cta");

    if (cta) {
      cta.textContent = "Start your pilot";
    }
  }

  // Returning evaluator

  if (journey.sessions >= 3 && !journey.converted) {

    const banner = document.getElementById("returning-banner");

    if (banner) {
      banner.style.display = "block";
    }
  }

  // Enterprise evaluator

  if (journey.signals.enterprise_hits >= 1) {

    const enterprise = document.getElementById("enterprise-contact");

    if (enterprise) {
      enterprise.style.display = "block";
    }
  }

  // LinkedIn traffic personalization

  if (journey.channel === "linkedin") {

    const hero = document.getElementById("hero-subtext");

    if (hero) {
      hero.textContent =
        "Used by modern B2B GTM teams running high-volume evaluation traffic.";
    }
  }

  // Forward evaluator state into your own backend

  if (
    journey.intent_state === "high" ||
    journey.sessions >= 3
  ) {

    fetch("https://your-backend.com/jourvex/state", {
      method: "POST",

      headers: {
        "Content-Type": "application/json"
      },

      keepalive: true,

      body: JSON.stringify({
        journey_id: journey.journey_id,
        intent_state: journey.intent_state,
        intent_score: journey.intent_score,
        sessions: journey.sessions,
        converted: journey.converted,
        channel: journey.channel,
        archetype: journey.archetype,
        signals: journey.signals
      })
    });
  }

});

When state updates

Evaluation state updates after sessions are processed and stitched into the visitor journey.

In most cases this happens within a few minutes after session activity ends.

On future visits the latest available state resolves immediately on page load, allowing onboarding, messaging, and workflows to adapt from the start of the session.

State does not continuously mutate live during a single browsing session. Updates reflect completed session processing.

Combining with the Journey API

The State API is optimized for lightweight real-time branching.

When you need the complete evaluator timeline, including full session history and event-level reconstruction, use the journey_id to fetch the full journey object from your backend through the Journey API.

See the Journey API and Examples pages for complete workflow implementations.

Rate limits

Endpoint
Limit
Notes
GET /api/state/{identity}
30 per minute
Automatically called by jvx.js during page initialization.