Keeping track of users visited pages?

Hello everyone!

I am about to build a “Help Center” in my phoenix/elixir app. Basically a Bubble on the bottom right of the layout that will open when it’s the first time a users goes into a page (first time since the user’s creation).
Then every time the user goes back to that visited page, the bubble is closed. It will open again when clicked.

My question here is how to keep track of the users visited pages. I though about creating a new table called “visited_paged”, for instance, with a user_id column, and X amount of columns for each page I want to keep track. Something like this:

    id |  user_id  |                     categories                 |     dashboard.    | plans     | 
   1   |      x    |     {index: true, show: false, edit: false}    |        ....       |    ....   |
   2   |      y ....

For every time a user visits a page, for instance categories/show page, the value of the show key on the categories column, will turn to True. That’s how I will know if it was visited or not.

Do you have any other better suggestions?

Thanks for your time!

1 Like

I would prefer not to have all the pages on the same record, because it isn’t flexible.

Something like this…

id, user_id, page_title, action

1, x, "categories", :index
1 Like