Tours


Description

This JS API provides you access to all product tours. Access methods on this object:

productFruits.api.tours

 

Methods

getTours()

Returns an array of all tours. The tour object contains idname and userState fields. Possible userState values are not_finished (the user haven't seen the tour yet), finished (the user finished the tour) or skipped (the user skipped the tour).


tryStartTour(id)

Starts a tour by the given ID. The current user state is restarted to not_finished. Please note that all rules and segmentations are taken into account, so the tour doesn't have to start if the current context is invalid.


listen(event, callback)

Listens to an event that occurs on tours. See the next section to get event names.

 

Events

tour-finished

Arguments Tour ID

Fired when the given tour is finished by the user. It is NOT fired when the tour is skipped (see the next event).


tour-skipped

Arguments Tour ID

Fired when the given tour is skipped by the user.