AMP

Important: this component does not support your currently selected format ads!

amp-access-poool

Description Displays a Poool paywall
. See poool.tech and demo.poool.tech for more details. amp-access-poool is based on, and requires, AMP Access.
Required Scripts Notice that you need scripts for "amp-access-poool" and "amp-access".
<script async custom-element="amp-access" src="https://cdn.ampproject.org/v0/amp-access-0.1.js"></script>
<script async custom-element="amp-access-poool" src="https://cdn.ampproject.org/v0/amp-access-poool-0.1.js"></script>

Behavior

The amp-access-poool component, based on amp-access, loads and shows a paywall using your bundleID from Poool's Dashboard configuration.

As you'll know if you're familiar with how Poool works outside of AMP, you cannot use excerpt and hide modes here. This is due to AMP's specific behavior. You will be able to lock or unlock your content with the access variable which is provided by amp-access. Check out the poool-widget section just below.

The amp-access-poool component does not require an authorization or pingback configuration because it is pre-configured to work with Poool.

For more information about modes, check out our SDK documentation.

Configurations

HTML sections

Set poool-widget section, which contain poool paywall when access isn't granted.

The amp-access-poool component requires 3 different sections:

  • The article preview, shown when access hasn't been granted yet (with amp-access="NOT access") and identified by Poool using the poool-access-preview attribute
  • The article content, shown when access has been granted (with amp-access="access"), hidden by the amp-access-hide attribute until access has been granted, and identified by Poool using the poool-access-content attribute
  • Poool's Paywall container, shown when access hasn't been granted yet (with amp-access="NOT error AND NOT access"), identified by Poool using the poool id
<section poool-access-preview amp-access="NOT access">
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur
    ullamcorper turpis vel commodo scelerisque.
  </p>
</section>

<section poool-access-content amp-access="access" amp-access-hide>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur
    ullamcorper turpis vel commodo scelerisque.
  </p>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur
    ullamcorper turpis vel commodo scelerisque.
  </p>
  <p>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur
    ullamcorper turpis vel commodo scelerisque.
  </p>
</section>

<section amp-access="NOT error AND NOT access" id="poool"></section>

amp-access script - poool config

Example: Basic paywall configuration (with default values)

Configuration is similar to AMP Access, except no authorization, pingback or login url is required.

<script id="amp-access" type="application/json">
  {
    "vendor": "poool",
    "poool": {
      "bundleID": "Your app id provided by poool",
      "pageType": "premium",
      "itemID": "amp-example-article"
    }
  }
</script>

Example: Show a paywall for a user in a custom group/segment called "amp-custom-segment"

<script id="amp-access" type="application/json">
  {
    "vendor": "poool",
    "poool": {
      "bundleID": "Your app id provided by poool",
      "pageType": "premium",
      "debug": "true",
      "cookiesEnabled": "true",
      "itemID": "amp-example-article",
      "customSegment": "amp-custom-segment"
    }
  }
</script>

For more information about configuration variables, check out our SDK documentation.

Notice

You have to set configuration attributes within AMP in camelCase instead of the underscore (" _ ") symbol traditionally used by Poool.

For example : use customSegment="amp-custom-segment" to achieve poool("config", "custom_segment", "amp-custom-segment");.

Attributes

bundleID (required)

Your App ID (you can find it on your Dashboard).

itemID (required)

Your unique article ID.

pageType (required)

Used to tell Poool that a page has been visited by the current user. See documentation for more information.

debug

Enable/disable debug mode. See documentation for more information.

forceWidget

Override current widget for user. See documentation for more information.

loginButtonEnabled

Enable/disable paywall "login" button. See documentation for more information.

signatureEnabled

Enable/disable paywall signature, shown under article content when the article has been unlocked. See documentation for more information.

videoClient

Set default video client (vast, googima) for video widget. See documentation for more information.

customSegment

Override native segments with a custom group/segment slug. See documentation for more information.

cookiesEnabled

Following latest GDPR requirements, we decided to disable cookies by default inside our paywall. You will have to explicitly set this attribute to reflect the user's consent. See documentation for more information.

Validation

See amp-access-poool rules in the AMP validator specification.

Need more help?

You've read this document a dozen times but it doesn't really cover all of your questions? Maybe other people felt the same: reach out to them on Stack Overflow.

Go to Stack Overflow
Found a bug or missing a feature?

The AMP project strongly encourages your participation and contributions! We hope you'll become an ongoing participant in our open source community but we also welcome one-off contributions for the issues you're particularly passionate about.

Go to GitHub