Is it possible to gate content after a user views, say, 3 pages in a directory?

Thanks in advance for your help!

Yes, this would be possible. There are a few ways that you can approach this:

The logic is the same for either method:

Create a work flow (either global or on each page) that checks a variable for page views, and then either lets them proceed or has a pass through condition that then has a redirect action that takes the user to another page.

The two main ways that you can store the variable of page views depends on your needs:

  1. Front end: Create a variable called “page_views” and store this in local storage (see post below for info on that). Keep track of the page views in this variable, and then redirect based on it. This is a less secure method, as it can be manipulated, but for general browsers and users it could work.

  2. Backend: Store the page_views variable in a database. Make a call to the database to retreive the page views and update it for every view. You can then redirect based on this variable. More secure, and stored in the backend database. Something like Xano.

There are many other ways to make this more secure, depending on your needs. I could put together more info on how to do this if you let us know what your needs are.

3 Likes