Sometimes you may wish to show different tours to users based on how long they have been using your app. For example you may only want to show certain tours to users who recently signed up. In this example we are going to explore how have a tour only show to users who have joined in the last x days.
In this example we are going to pass a daysSinceSignup user property to HelpHero.
<script> // assumes user object with id (string or number) and createdAt (Date) exists in scope // the implementation will varying depending on your development setup HelpHero.identify(user.id, { daysSinceSignup: Math.floor((Date.now() - user.createdAt.getTime()) / 86400000) }); </script>
Now that HelpHero knows about this new user property you can setup tours to only show if the user signed up within a certain number of days.