Tips on debugging Guided Tours
My tour is not shown more than once
After a tour is shown, it is recorded in the user's guided tours history and it will not be shown again. To determine if that's the case:
- Enable the debug info for Guided Tours:
localStorage.setItem( 'debug', 'calypso:guided*' ). - Guided Tours calculates
eligibleTours = reachedTours - seenTours, so if your tour is in theseenarray, then you have to reset the history.
In the following example, the tours gdocsIntegrationTour and editorInsertMenu were already seen by the user, so they won't be shown again.
Currently, there is no systematic way of clearing a user's history for debugging. One way you can clear it is by applying the clean-history.patch to your working tree.
To do this, run git apply client/layout/guided-tours/docs/patch/clean-history.patch from the application root directory.
Reload the page to clean the history, then remove the patch again.
My tour is only shown when called via the query arg
If your tour is only shown when it is called via the query arg (?tour=<TOURNAME>), there are two places to check:
- Are the user preferences missing? The Guided Tours debug output should include a line like No fresh user preferences, bailing. A typical scenario you may run into is that your 2FA token is stale: visit the
/mesection and either disable the 2FA or introduce a valid code. - Does your tour specify a path via
<Tour path="/path">? If so, is the path reached? The tour should be included in the debugging output forreachedToursif the path is indeed reached (see previous section). - The triggers for your tour, meaning the
whenfunction in<Tour name=… when=…>. - Any step-specific conditions? Check your steps for
whenfunctions too.
