Paywall setup

When all parameters are properly set, you need to configure the setup to match your paywall type. It should be an editorial decision whether you want or not to track visits if the paywall element appears on the page because anonymous users can't read much of the content.


1. The first option is to track all visits, regardless of the fact that full article content may not be loaded for anonymous visitors i.e. those that don't have full (premium) access.

In that case, please make sure that the maincontent property is properly set if the visitors can't read the entire article because the article preview will have fewer words than a fully loaded article.
Please provide appropriate values for the following properties:
access_level - can be set to "free" or "paid".
reader_type - can be set to "anonymous", "registered", or "subscribed".
Anonymous users are all that are not logged in while browsing the site.
If your subscription has more than two user types, you will have to map it somehow to match one of the required options: "registered" or "subscribed".
Registered users are those that are logged in but they may not have access to premium content.
Subscribed users are usually those who have full access to all your content.
2. The second option would be to disable tracking.
If that's the case, this could be set like this or a similar solution:
if (PAYWALL) {
// do not load CI tracking code
_ain.trackauto = false;

Please note that the PAYWALL is an arbitrarily named variable that you should replace according to your paywall settings.

Considering this, there are only three options of interest:

// 1) anonymous user reads a free article:

_ain.access_level = "free";
_ain.reader_type = "anonymous";

// 2) subscribed/registered user reads a free article:

_ain.access_level = "free";
_ain.reader_type = "subscribed"; //or "registered"

// 3) subscribed/registered user reads a paid article:

_ain.access_level = "paid";
_ain.reader_type = "subscribed"; //or "registered"

You probably have some variables that can be used to set a condition for the proper access_level and reader_type values.

You are free to modify or find another solution of your choice.

If you have any questions or doubts please contact our Support team: