Hey,
Do the Product Tours javascript intergration offer a Javascript callback?
I want to identify (on site) when a product tour has started for a user.
Flow:
- User visits a given page on the website
- Product Tour starts
- I need to check if a certain element is on the page as this is used by the tour. There is a few user cases when it wont, and I therefore need to run some custom (on site) Javascript to show that element.
- Workflows or webhooks won’t help in this situation, as I need to check and show the on-site element as soon as the tour starts. (well, actually before step 3)
Ideas:
- Javascript callback when the tour is started
- OR Javascript callback when a ‘next’ button is clicked on the tour
- OR another way to programatically (on-site) determine either of the above.
If this is entirely not possible, is there a way to detect if a user is due the tour?
At the moment the tour uses normal settings within the Intercom > Product Tour (i.e. show once, the first time the user meets given criteria). If I can disable the automatic showing within Intercom, but instead trigger it on site with `Intercom('startTour', tourId)`, then I can trigger my custom Javascript on-site at the same time.
BUT to acehive this, I need to know on-site if the tour should be shown or not, otherwise everytime the user visits the page the tour will be triggered by `Intercom('startTour', tourId)`.
I could do this interally, recording if the user has seen the tour in my local database or indeed a Intercom > User > Custom Attribute, but that seems inefficient. If a user has done a tour, is this stored against their User record and then available programatically (i.e. removing the need for a custom attribute)?
Thanks
Rob