Skip to content

Commit c46d855

Browse files
lkuangPRlkuangAlt
andauthored
docs: add user journey step tracking docs to perfume site
Co-authored-by: Lawrence Kuang <lawrence.kuang@coinbase.com>
1 parent 5ff133c commit c46d855

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

Diff for: docs/src/app/app.component.html

+43
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,46 @@ <h3 class="box-title" id="/element-timing">
398398
</table>
399399
</div>
400400
</div>
401+
<div class="box">
402+
<h3 class="box-title" id="/user-journey-step-tracking">
403+
<a href="{{ path }}#/user-journey-step-tracking">User Journey Step Tracking</a>
404+
</h3>
405+
<p>
406+
A Step represents a slice of time in the User Journey where the user is blocked by system time. System time is time the system is blocking the user. For example, the time it takes to navigate between screens or fetch critical information from the server. This should not be confused with cognitive time, which is the time the user spends thinking about what to do next. User Journey steps should only cover system time.
407+
</p>
408+
<p>A Step is defined by an event to start the step, and another event to end the step. These events are referred to as <b>Marks</b>.</p>
409+
<p>As an example, a Step could be to navigate from screen A to screen B. The appropriate way to mark a start and end to this step is by marking the start when tapping on the button on screen A that starts the navigation and marking the end when screen B comes into focus with the critical data rendered on the screen.</p>
410+
<div class="box-code js">
411+
<table>
412+
<tbody>
413+
<tr>
414+
<td class="code">
415+
<pre>
416+
<span class="gray">// Marking the start of the step</span>
417+
<span class="red">const</span> <span class="blue">ScreenA</span> <span class="red">= () =></span> ({{'{'}}
418+
<span class="red">const</span> <span class="blue">handleNavigation</span> <span class="red">= () =></span> {{'{'}}
419+
<span class="gray">// Navigation logic</span>
420+
<span class="gray">// Mark when navigating to screen B</span>
421+
<span class="violet">markStep</span><span>('navigate_to_screen_B')</span>
422+
}
423+
<span class="violet">return </span>(
424+
<span class="violet">{{'<'}}Button</span> <span class="blue">onPress</span><span class="violet">="</span><span class="red">{{'{'}}handleNavigation}</span><span class="violet">" </span><span class="violet">/></span>
425+
)
426+
})
427+
428+
<span class="gray">// Marking the end of the step</span>
429+
<span class="red">const</span> <span class="blue">ScreenB</span> <span class="red">= () =></span> ({{'{'}}
430+
<span class="red">const</span> <span class="blue">{{'{'}} data }</span> <span class="red">=</span> <span class="violet">fetch</span><span>("http://example.com/data")</span>
431+
432+
<span class="violet">useEffect</span><span>(() =></span> {{'{'}}
433+
<span class="red">if</span> <span>(data)</span> {{'{'}}
434+
<span class="violet">markStep</span><span>('loaded_screen_B')</span>
435+
}
436+
},[<span class="blue">data</span>])
437+
})</pre>
438+
</td>
439+
</tr>
440+
</tbody>
441+
</table>
442+
</div>
443+
</div>

0 commit comments

Comments
 (0)