Syncronex Knowledge BaseIntegrationPaymeter SDKCMS Integration - Metering a Page (Default Configuration)

CMS Integration - Metering a Page (Default Configuration)

The Paymeter business rules are executed at the page-level.  A metered page must include an HTML script tag that references the property-specific Paymeter SDK "Loader".

<script src='https://syncaccess-sync-demo2.stage.syncronex.com/sync/demo2/api/scripts/syncwall'></script>

The Paymeter loader  will dynamically load both the PaymeterSdk.js and OverlaySdk.js libraries from a content delivery network.  Once those libraries are available, the loader will set some initial configuration properties and then trigger the content authorization process.

Page Content Category

Paymeter business rules center around a page's Content Category.  This is just a text value that is used to classify the page and associate it with specific business rules like page view limits, alert thresholds, etc.  Content category can be any text value (it should not contain spaces or special characters like '&,%,@,^ etc.'.  

There is no validation performed against the Content Category.  Any content category value that is not recognized by the server as having a specific set of associated business rules will be processed using the default business rules.  There is no requirement to pre-configure content categories unless you specifically want different rules to apply to your page.

The content category is specified by using a custom HTML meta tag:

<meta name="__sync_contentCategory" content="sports">

The Loader and PaymeterSdk will look for the page's content category by searching the DOM for this specific Meta tag.  If the tag cannot be found, the metering process will immediately stop and the user will get unrestricted access to the page content.

Free Content

There are three ways to mark a page as unrestricted.  The easiest is to omit the required script tag that associates the page to the Paymeter (or by omitting the required Meta tag and not providing an alternative method of setting the content category).  In this case, the Paymeter authorization will never get triggered and the user will have unrestricted access to the content.

The second way to mark a page unrestricted is to use the reserved value of 'free' as your content category like this:

<meta name="__sync_contentCategory" content="free">

In this case, the Paymeter authorization will be triggered but the server will recognize the content category as a 'free' category and will return a value to the PaymeterSdk indicating the user is allowed access to the content.

Typically, a customer would use this method if it was important to know that the Paymeter was being exercised but no restrictions were applied to the content.

The last way to mark a page unrestricted is to assign it a specific content category value (other than 'free') and then configure that new content category value as a free content category within the Paymeter business rules.

 

This works just like the reserved category of 'free'.  The Paymeter will still be triggered but the server will recognize the content category as unrestricted and will respond back to the page with a value indicating that the user is authorized to view the content.

Tenant Id

If you are using the Customer Domain feature in syncAccess, you must configure the tenantId on your metered pages.  The TenantId tells the metering code which services should be called when authorizing users. Every syncAccess customer has their own instance of the system and then tenantId identifies that instance.  If you are not using the Customer Domain feature, then the tenantId is part of the url you use to reference the syncAccess libraries so there is no need to explicitly configure it.

The TenantId is set with a meta tag in the <head> section just like the content category:

<head>
    <meta name="__sync_tenantId" content="acme_pub1">
</head>
Click to copy

Syncronex Support can give you your tenant Id if you haven't gotten it already.  

Not sure if you're using Customer Domain functionality or not?  If you are accessing Syncronex services using a url that contains your own domain, then you're using Customer Domain functionality. For example, if you are accessing the paymeter library from a url that looks like this:

https://subscribe.yourdomain.com/abc/xyz/api/scripts/syncwall

Then you're using the Customer Domain feature.   This feature allows Syncronex to host the syncAccess application and services from behind your own web domain.  Contact Syncronex Support if you'd like to know more.

Note: The standard url (if you're not using Customer Domain) looks more like this:  https://syncaccess-abc-xyz.syncronex.com/abc/xyz/api/scripts/syncwall