We’ve migrated our documentation to a new site, which means some URLs have changed.
Subscriptions

How to create an AdFree Experience for paying subscribers?

As a first step, you would need to create two versions of your website on your hosting service. One would be containing ads on all relevant pages and the other version would be without ads.

When a user comes to your website with ads, you would decrypt the user's __tac cookie using our Piano PHP SDK. The download link for this library is available here.

The steps to do this would be as follows:

  1. Access the value in the __tac cookie.

  2. URL decode the value, and remove the {jax} prefix.

  3. Then decrypt using the private key from the Piano Dashboard.

  4. For each resource that the visitor has access to, you will get the following values in a JSON string.\n

    ACCESS_ID = “id”;
    \nBUILD_TIME = “bt”;
    \nRID = “rid”;
    \nUID = “uid”;
    \nEX = “ex”;
    \nEARLY_EX = “eex”;
    \nCREATED_TIME = “ct”;

More information on how to check for access is available under this link.

Based on the returned active access your server then can show the user the website version without ads - or an ad lite version. Please note, that this would require some work on your end.

Last updated: