#Configuration

While the default configuration works for most use cases, you might want to configure some of Access.js behaviors.
ℹ️ Your Dashboard configuration will override these configuration values unless they have been set with a read-only mode.

#Usage

.config(optionName: String, optionValue: Any, readOnly?: Boolean): this

.config(options: Object, readOnly?: Boolean): this

#Options

#debug

  • Type: Boolean
  • Default: false
When debug mode is enabled, Poool's SDK will log everything it does in the browser console.

#mode

  • Type: String
  • Accepted values: 'hide', 'excerpt', 'custom'
  • Default: 'hide'
This is the method used by Poool to lock the content of your article.
Available modes:
  • hide: Your original content will stay where it is, but its container will be modified with css to hide a percentage of the content. Downsides : Users will be able to open the browser's console and remove the css rules.
  • excerpt: Your original content will be placed in a view holder and its container will have its content replaced by trimmed text (only X% of the text will be kept). The original content is not available from outside of Poool.js scope (even from console), and will be put back when onRelease event is fired. Downsides : <style> and <script> tags inside parent are temporarily detached from trimmed text and put at the end. If you have various <script> tags in your content, they won't necessarily be executed and may even throw javascript errors (such as with some ad scripts that still use obsolete javascript functions), leading to a blank page when unlocking content. This mode is also not recommended for single-page apps (Angular, React, Vue, ...). In these two cases, we suggest that you use hide mode.
  • custom: Nothing will be done to your content and/or its container, but onLock and onRelease events will be fired so you can do your own processing.

#percent

  • Type: Number
  • Default: 80
Percentage of text you want to be hidden/stripped.

#post_container

  • Type: String
  • Default: '[data-poool]'
CSS Selector locating the post content you want to lock.

#widget_container

  • Type: String
  • Default: '#poool-widget'
CSS Selector locating the container where Poool will put its paywall.

#app_name

  • Type: String
  • Default: ''
Used to set your media's display name for some widgets. This value may be overridden by Dashboard configuration.

#force_widget

  • Type: String
  • Accepted values: 'auto', 'hidden', 'disabled', 'none', 'video', 'newsletter', 'subscription', 'gift', 'question', 'unlock', 'link', 'pass', 'unlock', 'invisible'
  • Default: 'auto'
Overrides default paywall behavior and forces a particular type of widget (the type of widget shown by default can differ according to user behavior).

#subscription_url

  • Type: String
  • Default: null
Your subscription page URL. The subscription widget will redirect the reader to this when they decide to subscribe.
{return_url} variable can be used to get the current URL.
{user_id} variable can be used to get the reader's Poool id.

#newsletter_name

  • Type: String
  • Default: null
The name of the newsletter, linked to the registered email address of a user on the newsletter widget.

#newsletter_id

  • Type: String
  • Default: null
Id of the newsletter, linked to the registered email address of a user on the newsletter widget.
You will then be able to get all registrations for a particular user through Poool's API.

#login_url

  • Type: String
  • Default: null
Your login page url. A user will be redirected here after clicking on the login button.
{return_url} variable can be used to get the current URL.
{user_id} variable can be used to get the reader's Poool id.

#login_button_enabled

  • Type: Boolean
  • Default: true
Shows/hides the login button on every widget.

#signature_enabled

  • Type: Boolean
  • Default: true
Shows/hides signature text placed at the end of the article once it has been unlocked.

#user_is_premium

  • Type: Boolean
  • Default: false
Allows you to set a reader status to already subscribed.
⚠️ This value isn't used to automatically unlock the paywall but only for statistical purposes.

#video_client

  • Type: String
  • Accepted values: 'vast', 'googima'
  • Default: 'vast'
Allows you to set the player client for the video widget.

#popover_enabled

  • Type: Boolean
  • Default: true
Shows/hides the popover displayed when the paywall is not already inside the viewport.

#alternative_enabled

  • Type: Boolean
  • Default: true
Shows/hides the 'No, thanks' link for several widgets.

#alternative_widget

  • Type: String
  • Accepted values: 'none', 'video', 'gift', 'question', 'subscription'
  • Default: 'none'
Overrides the default alternative action used by several widgets.

#vast

  • Type: String
  • Default: null
URL needed to display video ads inside the video widget on the desktop.

#mobile_vast

  • Type: String
  • Default: null
URL needed to display video ads inside the video widget on mobile devices.

#context

  • Type: String
  • Default: null
Used to assign a particular custom context to a reader.
If no context is specified, native contexts or a default one will be used instead.

#custom_segment

  • Type: String
  • Default: null
Used to allocate a reader to a custom group previously created in Poool's Dashboard.

#cookies_enabled

  • Type: Boolean
  • Default: false
Enable/disable all tracking actions used by Poool according to the latest GDPR compliancy measures.
  • Type: String
  • Accepted values: 'invisible', 'unlock', 'gift', 'subscription'
  • Default: 'subscription'
Allows to define the widget to display by default, if {cookies_enabled} config option is false (cookies consent rejection).

#data_policy_url

  • Type: String
  • Default: null
Link URL shown inside widgets that require the collection of user information.
{return_url} variable can be used to get the current URL.
{user_id} variable can be used to get the reader's Poool id.

#locale

  • Type: String
  • Accepted values: 'fr', 'en'
  • Default: 'fr'
Current paywall locale.

#popover_timeout

  • Type: Number
  • Default: 5000
Popover display timeout (in milliseconds).
If the value is set to -1, the popover will keep being displayed.

#disable_content_height_calculation

  • Type: Boolean
  • Default: false
When hide masking mode is used and after unlocking an article, Poool's paywall will try to calculate the height of the content to set it back to its default value.
In a few rare cases, the size of the content will change between when it's cropped and when it's unlocked (loading twitter modules, loading gifs, etc...).
If disable_content_height_calculation is set to true, the paywall won't try to calculate content height and will simply strip all CSS modifications applied to the parent container of the article.

#wait_for_dom_load

  • Type: Boolean
  • Default: false
By default, to avoid long loading times, our paywall will not wait for the page to load to be displayed.
In some cases, you'll have to wait for the DOM to fully load before the paywall can detect the content of the article that you want to lock (especially when it is placed inside the <head> tag of the page).
If wait_for_dom_load option is true, the paywall will wait for the DOMContentLoaded event to be fired.

#dom_load_timeout

  • Type: Number
  • Default: 2000
Defines the paywall default wait time for the DOMContentLoaded event of the page to be fired (if wait_for_dom_load is set to true).

#paywall_load_timeout

  • Type: Number
  • Default: 10000
Defines the default wait time for the Paywall to be fully displayed. After this time has lapsed, the `onError` event is triggered so that you can display a backup paywall.

#track_original_action

  • Type: Boolean
  • Default: false
Track unlocked articles based on original action instead of its alternative.
When an article is unlocked using an alternative (for example if force_widget is used or if the user clicks on No, thanks), by default reports will show statistics for this alternative action rather than the original one.

#components_load_timeout

  • Type: Number
  • Default: 5000
Defines the default wait time for all the components inside the Paywall to be full loaded. After this time has lapsed, the onError event is triggered so that you can display a backup paywall.

#ati_tracking_enabled

  • Type: Boolean
  • Default: false
Enable/disable AT Internet additional tracking (AT Internet SDK integration required). ⚠️ Deprecated : replaced by ati_auto_tracking_enabled.

#ati_load_timeout

  • Type: Number
  • Default: 2000
Defines the default wait time for the tracking event from AT Internet to be fired. After this time has lapsed, the paywall is loaded using the default method, and all tracking from Poool to AT Internet is disabled.

#facebook_login_enabled

  • Type: Boolean
  • Default: false
Enable/disable Facebook login button inside the paywall. In order to sign-in using Facebook, you have to call Facebook's login SDK when onFacebookLoginClick event is fired.

#google_login_enabled

  • Type: Boolean
  • Default: false
Enable/disable Google login button inside the paywall. In order to sign-in using Google, you have to call Google's login SDK when onGoogleLoginClick event is fired.

#ati_auto_tracking_enabled

  • Type: Boolean
  • Default: false
Enable/disable automatic AT Internet tracking (AT Internet SDK integration required) for particular events.
⚠️ AT Internet SDK Version 5.7 or higher is required.

#ga_auto_tracking_enabled

  • Type: Boolean
  • Default: false
Enable/disable automatic Google Analytics tracking (Google Analytics SDK integration required) for particular events.
⚠️ Regular Google Analytics SDK integration required, e.g using ga() tracking method.

#gtm_auto_tracking_enabled

  • Type: Boolean
  • Default: false
Enable/disable automatic Google Tag Manager tracking (GTM SDK integration required) for particular events.
Every event information is pushed to the dataLayer with the same structure as a Google Analytics event.

#custom_reader_id

  • Type: String
  • Default: null
Used to assign your own unique custom identifier to one of your readers.

#stripe_public_key

  • Type: String
  • Default: null
Used to enable Stripe credit card form fields inside the paywall.

#popover_auto_hide

  • Type: Boolean
  • Default: true
When scrolling, if the widget shows up on the screen (onWidgetSeen event), the popover will automatically disappear.
You can use popover_auto_hide with the value set to false to disable this behavior.

#custom_return_url

  • Type: String
  • Default: null
When a reader is redirected from the paywall (click on login/subscribe links or Link widget's main action), the return_url query params is provided to the new url. Its default value is the current url.
You can use custom_return_url to define your own custom return url.

#cookies_domain

  • Type: String
  • Default: null
Used to define your own custom domain for Poool cookies.

#default_widget

  • Type: String
  • Accepted values: 'invisible', 'unlock', 'gift', 'subscription'
  • Default: 'subscription'
Used to defined a widget to display in case of network error.
It is then possible to unlock the content manually (ex: gift, etc..) or automatically with invisible.
Please check the guide named Handle timeouts & errors for more information.

#fallback_widget

  • Type: String
  • Default: 'subscription'
Used to defined a fallback widget in case of error on advertising widgets (video, viewpay).
Prefer to configure this option in your dashboard (widget edition), especially if your fallback widget requires data (eg: question or form widgets).

#audit_load_timeout

  • Type: Number
  • Default: 2000
In case of a complete integration with Audit and Access, the audit_load_timeout config parameter is used to define the wait time (in milliseconds) for the Audit response.
If case of timeout, Access will directly display your paywall. Regarding native segmentation, reader may not be correctly updated.

#beacons

  • Type: Boolean
  • Default: true
Whether or not to send some tracking requests (mostly clicks behind a redirect) using navigator.sendBeacon instead of a normal XHR request.

#cookies_path

  • Type: String
  • Default: '/'
Used to define your own custom path for Poool cookies.