3

I'm using introjs.

But when a user ends the intro, then refreshes the page, introjs starts up again.

Is there a way to only show a walkthrough once per user?

For example I have it where when a user first signs into my website - introjs will popup. I only want it to pop up for that initial welcome.

Potential Solutions

  1. Maybe there is a way to trigger introjs via the create action like one would with a flash message?
  2. I could replicate all my header, sidebar, and challenges section code into pages/tutorial.html.erb and make a route www.websitename.com/tutorial, but then that would be a lot of code to duplicate and then whenever I change something in the site I would have to change it in tutorial too.
  3. Is there a way to adjust this javascript method in application.js to trigger only once per user $(function () { introJs().start() })?

I just use data-intro="" for each step of the walkthrough.

AnthonyGalli.com
  • 2,796
  • 5
  • 31
  • 80
  • 1
    Server side storage - MySQL, redis, etc. client side strategies won't help you as soon as the user clears their browser cookies. – baao Mar 12 '16 at 21:08

1 Answers1

3

You want your application/webpage to remember that the user has already gone through your tutorial.

There are a few ways you can do that. For a start, you can use cookies or localStorage

The gist is that after the user finishes, or otherwise exits your tutorial, you can store a descriptive value to the user's client, by using one of the above methods, and on page load you should first check if this value exists and act accordingly.

EDIT: As mentioned in comments, you will need a server side approach as well.

Dimitris Karagiannis
  • 8,942
  • 8
  • 38
  • 63