HelpHero has a built in analytics solution which automatically tracks the amount of tours started, tours completed and how far users are getting through your tours.
However if you would prefer to have these stats show up in a analytics provider such as Google Analytics, Mixpanel etc by using the JavaScript API.
Here’s an example which creates a Google Analytics event when a tour is started, completed or cancelled.
<script> function helpHeroTrackEvent(ev, info) { // required for google tag manager compat var cmd = typeof ga.getAll === 'function' ? ga.getAll()[0].get('name') + '.send' : 'send'; ga(cmd, 'event', 'Tour', ev.kind, info.tour.name); } HelpHero.on('tour_started', helpHeroTrackEvent); HelpHero.on('tour_completed', helpHeroTrackEvent); HelpHero.on('tour_cancelled', helpHeroTrackEvent); </script>
Note: make sure you include this code after your HelpHero script tag. You can find your HelpHero script tag on step 1 of your install instructions.