Skip to main content
Level 2
Oct 10, 2024 9:12 AM UTC

How to implement a paywall (lead-in) content on a page

As part of a site we have a login/subscription model that will restict content visibility to the end users.

 

We want to implement this as a paywall (lead-in) functionality. i.e. when i am logged out/web crawler/logged in but not with the right subscription, then you only see a small portion of the content on the page so that the site can still be crawled by 

 

We want to do this in a way that the page in AEM has all of the content that can be visible, and we want to make using of dispatcher caching of the content.

We don't want to use a javascript function to hide the content as you can inspect the spite, or view page source to get the entire content which will violate the subscription model.

 

Is there any way within the dispatcher of caching different versions based on the users access, or a way to have a cached response based on the cug groups.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

6 replies

narendiran_ravi
Level 6
Oct 10, 2024 9:33 AM UTC

You can achieve this using Sling Dynamic Include. Refer to this link for more details. Write the logic on the server side to validate if the user has the correct subscription.

Translate
Level 2
Oct 16, 2024 12:20 PM UTC

Sling dynamic includes are not supported in AEMaaCS

Translate
daniel-strmecki
Adobe Champion, Community Advisor, UG Leader
Adobe Champion, Community Advisor, UG Leader
Oct 16, 2024 12:26 PM UTC

@taggatmerklewe are using them for years on AEMaaCS

Translate
arunpatidar
Community Advisor
Community Advisor
Oct 15, 2024 11:16 AM UTC

Hi @taggatmerkle 

 

You can handle this with dispatcher, based on login cookie rewrite page request with additional selector to show full content otherwise default content or vice-versa.

 

However you need to take care of any additional cache e.g. CDN or browser cache, in this case no-store, so that consumer always get page from dispatcher cache.

 

Translate
Arun Patidar
Level 2
Oct 16, 2024 11:26 AM UTC

No, the solution doesn't meet our needs. In the end I am going for a microservice sitting in front of AEM which will handle the reduction of content to only what is public, removing anything that should only be available based on their subscription. 

We will mark the content using the style systems so the microservice knows what to remove

Translate
kautuk_sahni
Level 9
Oct 16, 2024 9:26 AM UTC

@taggatmerkle Did you find the suggestions helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!

Translate
Kautuk Sahni