I have always wanted to be able to track the path that users take through the portal and get a better idea of their user journey. I created this proof of concept to see if I could firstly track the user’s path, and secondly display that data in a manner that is visually appealing.
After some research I discovered that sunburst charts are quite often used to display this type of data and I found some posts by people far more clever than I, who use the d3.js library to achieve these types of charts.
Armed with the above example I set about recreating it within ServiceNow and tracking users journeys within the service portal itself. The below video shows my proof of concept in action.
I use impersonation in an incognito browser to crudely simulate different users visiting the portal and taking somewhat different paths. For one of the user’s visits I start at “sc_home” instead of “index” to show how user’s journeys don’t always start on the same page (they may open via a link or a desktop shortcut). Hopefully it is enough to prove the concept works, but ideally a larger data set (like in the screenshot at the top of this article) would be nice to look at.
There are a number of areas that need some serious attention, namely:
- At the moment every page gets a random colour assigned on load. This leads to some colour clashes on occasion.
- Each journey is limited to displaying up to the first 6 steps (which is the same as the example I linked to above) – I assume this is for readability reasons.
- As with most things service portal related it isn’t portal agnostic, so we can’t tell which portal the users used to hit those pages.
Although not shown in the video, I also coded it with a system property to denote a time in minutes that would constitute a new “journey”. In other words if a user hadn’t changed pages after X minutes, still has their browser open and then does change page it would create that as a new journey; if a user keeps changing pages within the X minutes window then those steps are tagged onto the same journey.
It was certainly fun to build out as a proof of concept.