Journeys

Journeys

  1. Step 12,400 sessionsentered
  2. Step 2620 reached1,180 exited (65.6%)
  3. Step 3140 reached480 exited (77.4%)
    • Gift Wrap/gift-wrap
<div class="journey" data-orientation="vertical" aria-label="Checkout journey">
<ol>
<li>
<header><span>Step 1</span><strong>2,400 sessions</strong><small>entered</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Spring Sale</span><small>/spring-sale</small><data value="1800">1,800 sessions</data><data value="9000">$9,000.00 · $5.00 RPV</data></button></li>
<li><button type="button" aria-pressed="false"><span>Checkout</span><small>/checkout</small><data value="600">600 sessions</data><data value="4200">$4,200.00 · $7.00 RPV</data></button></li>
</ul>
</li>
<li>
<header><span>Step 2</span><strong>620 reached</strong><small>1,180 exited (65.6%)</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Checkout</span><small>/checkout</small><data value="620">620 sessions</data><data value="9000">$9,000.00 · $14.52 RPV</data></button></li>
</ul>
</li>
<li>
<header><span>Step 3</span><strong>140 reached</strong><small>480 exited (77.4%)</small></header>
<ul>
<li data-outcomes><span>Gift Wrap</span><small>/gift-wrap</small><div><button type="button" aria-pressed="true"><span>Declined</span><data value="96">96 sessions</data><data value="4800">$4,800.00 · $50.00 RPV</data></button><button type="button" aria-pressed="false"><span>Accepted</span><data value="44">44 sessions · 31.4% CVR</data><data value="2640">$2,640.00 · $60.00 RPV</data></button></div></li>
</ul>
</li>
</ol>
</div>

Without data-orientation the steps are columns side by side

  1. Step 12,400 sessionsentered
  2. Step 2900 reached900 exited (50.0%)
  3. Step 3310 reached330 exited (51.6%)
<div class="journey" aria-label="Store journey">
<ol>
<li>
<header><span>Step 1</span><strong>2,400 sessions</strong><small>entered</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Home</span><data value="1800">1,800</data></button></li>
<li><button type="button" aria-pressed="false"><span>Sale</span><data value="600">600</data></button></li>
</ul>
</li>
<li>
<header><span>Step 2</span><strong>900 reached</strong><small>900 exited (50.0%)</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Product</span><data value="640">640</data></button></li>
<li><button type="button" aria-pressed="false"><span>Search</span><data value="260">260</data></button></li>
</ul>
</li>
<li>
<header><span>Step 3</span><strong>310 reached</strong><small>330 exited (51.6%)</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Cart</span><data value="220">220</data></button></li>
<li><button type="button" aria-pressed="false"><span>Product</span><data value="90">90</data></button></li>
</ul>
</li>
</ol>
</div>

data-view="picked" shows only the page picked in each step

  1. Step 12,400 sessionsentered
  2. Step 2620 reached1,180 exited (65.6%)
<div class="journey" data-orientation="vertical" data-view="picked" aria-label="Picked path only">
<ol>
<li>
<header><span>Step 1</span><strong>2,400 sessions</strong><small>entered</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Spring Sale</span><small>/spring-sale</small><data value="1800">1,800 sessions</data><data value="9000">$9,000.00 · $5.00 RPV</data></button></li>
<li><button type="button" aria-pressed="false"><span>Checkout</span><small>/checkout</small><data value="600">600 sessions</data><data value="4200">$4,200.00 · $7.00 RPV</data></button></li>
</ul>
</li>
<li>
<header><span>Step 2</span><strong>620 reached</strong><small>1,180 exited (65.6%)</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Checkout</span><small>/checkout</small><data value="620">620 sessions</data><data value="9000">$9,000.00 · $14.52 RPV</data></button></li>
</ul>
</li>
</ol>
</div>

The page listens for pick to fill the later steps

  1. Step 11,000 sessionsentered

Picked: Home

<div class="journey" id="demo-journey-pick" aria-label="Picked page">
<ol>
<li>
<header><span>Step 1</span><strong>1,000 sessions</strong><small>entered</small></header>
<ul>
<li><button type="button" aria-pressed="true"><span>Home</span><data value="700">700</data></button></li>
<li><button type="button" aria-pressed="false"><span>Blog</span><data value="300">300</data></button></li>
</ul>
</li>
</ol>
</div>
<p class="text-muted-foreground mt-3 text-sm" id="demo-journey-pick-output">Picked: Home</p>
<script>
document.getElementById("demo-journey-pick").addEventListener("pick", (event) => {
document.getElementById("demo-journey-pick-output").textContent = `Picked: ${event.target.querySelector("span").textContent} in step ${event.detail.step + 1}`;
});
</script>

API Reference

Attributes

Attribute On Values Default Description
data-orientation .journey "vertical" none Stacks the steps, each further in than the one above, with a page on each full-width row. The line turns down and into the next step.
data-view .journey "picked" none Shows only the page picked in each step and hides the others. The page sets it, for example from an All Pages and Picked Path button group.
data-outcomes a page li none none Makes the li a page with outcomes, such as an upsell: its name and URL, then a div with a button per outcome (Declined, Accepted). Each outcome is picked like a page, and the line meets the row.
aria-pressed a button "true", "false" set by the script Marks the page picked in its step. A click sets it, and clears it in every later step.
aria-label .journey text none Names the journey for a screen reader.

Events

Event On Detail Description
pick a button { step } Sent after a click picks a page. The step is its index from 0. It bubbles.

Keyboard

Key Description
Tab Moves to the next page. It is the browser's own.
Enter, Space Picks the page. It is the browser's own click on a button.
Arrow Down, Arrow Up Moves to the next or the previous page in the step. In a vertical journey, to the next or the previous page in any step.
Arrow Right, Arrow Left Moves to the page picked in the next or the previous step. They swap in right to left text. A vertical journey ignores them.

A line joins the page picked in each step to the page picked in the next.

The lines are drawn again when the steps or the picks change, so a page that adds steps calls nothing.

A page with outcomes keeps its name once; its outcomes are the buttons, and Accepted shows the take rate as CVR.

Once the script has started it, the element carries data-journey-initialized="true" and sends tsugi:initialized. The methods and properties above are on the element itself.