How to expire pages for specific users after X amount of views



Hi, just wondering if anyone has used any AEM features to solve this use case.

We have web articles we are allowing our users to see only for certain amount of views (e.g. 10). Each user has a unique URL to our AEM web page, where a Sling filter intercepts these requests and can identify who the user is (from URL encoded details), and the page ID they are trying to view. The user then gets redirected to view the underlying web page (asset) on Publisher instance.


The challenge is each user can only see a specific page X amount of times.Cannot lockdown the specific page since other users can still see, and cannot lockdown specific user as they can still see other articles. Obvious answer is to built something custom, tracking readership in a Database and checking each time - although am concerned about performance of adding this.  Am trying to se if AEM has something out-of-the-box (ish) which can assist on this - maybe paywall type functionality, since use case is similar - or something than can be 'tweaked' to aommodate this.


Would be great to hear if anyone has solved similar problem using AEM 6.5 capabilities.


Accepted Solutions (1)

Accepted Solutions (1)




AEM has AEM communities site which mainly deals with user and UGC. But not sure if you are using AEM Sites or AEM Community Sites.

To achieve this you need to store the page view count as per user, the storage could be cookie, local , database storage.

The another solution could be the Analytics, where you can store the user and path key and from Analytics you can handle the page response/reroute. Thats just an idea, not sure if Analytics can help here or not.

Answers (0)