In order to protect your monetization page, first, we need you to create your merchant account. For step-by-step instructions, please refer to the following guide. Once you are successfully logged in, you would be registered in the InPlayer system as a merchant.
Our platform supports almost all forms of online content: video, audio, text, HTML, file etc. out of which you can choose the one that best aligns with your needs. To begin with, you need to log into the InPlayer dashboard and click the 'Assets' icon from the navigation bar on the left. Then, click the '+Add new asset' button. This opens a window displaying the asset types. For the purpose of this guide let's choose the HTML/Text type. The following steps include naming your asset, setting the pricing type (choosing between login/register type or code/password as a means to gaining access), as well as setting the rest of the asset properties.
You get to customize the look of your asset preview by adding an image, title, description, and personalized 'Buy' button; then choose between a pay-per-view or subscription as a payment option; set any geographic, domain and/or age restrictions you have considered; add your HTML code of the content in the 'Asset content' section and embed the asset on your website, simply by clicking the 'Get Asset Embed Code' button at the top right. For a more picturesque guide on asset creation, please refer to the following guide:.
Once the asset is created, its Asset ID represents both your identity as a merchant in our system and your Premium Page. To find your Asset ID go back to the ‘Assets’ tab and you will find your newly created asset listed along with its Asset ID and other information such as its title, asset type, the date of creation and the date of the last update.
In order to establish maximum protection to your website, we introduce a use case where two pages are at play. The first one is where the end-users come to authenticate and pay for the content of interest. This is your Landing Page. Then, after a successful authentication and purchase have taken place, your users get redirected to another, second page where they can consume the content. This is your Premium Page.
Your Landing Page and our paywall thrive in a codependent relationship. More precisely, the core usage of the paywall is providing you, our merchant, with an embed code for your premium content so that you can embed it into your website. For each asset you create, a corresponding embed code is subsequently generated. To find and embed the code of interest, please refer to the following guide.
In order to implement the logic of having two pages coexisting, one for validating users' authentication and purchases and another where your content lays sheltered, you need to set your asset embed code options so that:
- have the
accesspaywall event implemented.
Enabling this asset option prevents the premium content from being displayed on your Landing Page. The idea is that right after a user has signed in, made a successful purchase, and gained access to your asset, they get redirected to your Premium Page. In this scenario, the content is not going to be displayed on your Landing Page since it is part of your Premium Page, where additional protection is in place.
You need this paywall event to implement the logic of extracting the end-user's token from the local storage of the browser and then converting it to a cookie. This is crucial for the logic on the Premium Page, which is discussed more at length below.
Additionally, if you would also like to have end-users automatically redirected to your Premium Page (rather than having them, say, pressing a button that would redirect them there), the
access event should also implement the logic to enable this redirecting. Of course, you can execute both the token extraction and redirection only if the current end-user has a verified access to your content.
Now that the customer is at your Premium Page, an access check needs to be executed before the customer can lay their hands on your content. For that reason, there should be a middleware setup on your part, that will fire every time a customer tries to reach your premium content. Once the Premium Page is accessed, the first thing to check for is a cookie with a token. The middleware searches the local storage of your browser to check whether there is a cookie with the customer's access token as value. If found, the next thing to check is whether the authenticated user has access to the premium content. For that purpose, the middleware then extracts the token and sends our API an access validation request. More precisely, the
Get item access request is fired with the specified Asset ID (Item ID) and the token as an authorization header.
If the API request returns a successful response, we let the customer reach the premium section of your page and access the content behind. In case of any of the above illustrated errors, we redirect the customer back to your Landing Page where they can try to register and/or complete the payment successfully this time.