We’ve migrated our documentation to a new site, which means some URLs have changed. If you hit a broken link, submit a support ticket.
Subscriptions

How to create an AdFree Experience for paying subscribers?

First, create two versions of your site on your hosting service: one with ads on relevant pages and one without ads.

When a user visits the ad-enabled site, decrypt their __tac cookie using the Piano PHP SDK. Download the library here.

Do the following:

  1. Read the __tac cookie value.

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

  3. Decrypt it using the private key from the Piano Dashboard.

  4. For each resource the visitor can access, you receive these values in a JSON string.

    ACCESS_ID = “id”;
    BUILD_TIME = “bt”;
    RID = “rid”;
    UID = “uid”;
    EX = “ex”;
    EARLY_EX = “eex”;
    CREATED_TIME = “ct”;

More information on checking access is available here.

Based on the returned active access, your server can display the ad-free or ad-lite version. This requires development work on your side.

Last updated: