Important: this documentation is not applicable to your currently selected format ads!
amp-access-poool
Description
Displays a Poool paywall.
Required Scripts
<script async custom-element="amp-access-poool" src="https://cdn.ampproject.org/v0/amp-access-poool-0.1.js"></script>
<script async custom-element="amp-access-poool" src="https://cdn.ampproject.org/v0/amp-access-poool-0.1.js"></script>
Usage
The amp-access-poool
component, based on amp-access
, loads and shows a paywall using your bundleID
from Poool's Dashboard configuration.
See poool.tech for more details. amp-access-poool
is based on, and requires,
amp-access
.
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
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");
.
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 thepoool-access-preview
attribute - The article content, shown when access has been granted (with
amp-access="access"
), hidden by theamp-access-hide
attribute until access has been granted, and identified by Poool using thepoool-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 thepoool
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.
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.
locale
Set default locale for all texts inside the paywall. See documentation for more information.
context
Override default or native contexts with a custom context value. See documentation for more information.
Validation
See amp-access-poool
rules in the AMP validator specification.
Anda telah membaca dokumen ini belasan kali, tetapi belum semua pertanyaan Anda terjawab? Mungkin orang lain merasakan hal yang sama. Berinteraksilah dengan mereka di Stack Overflow.
Kunjungi Stack Overflow Menemukan bug atau ada fitur yang kurang?Proyek AMP sangat menganjurkan partisipasi dan kontribusi Anda! Kami berharap Anda akan terus ambil bagian dalam komunitas sumber terbuka kami, tetapi kami juga menerima kontribusi satu kali untuk topik tertentu yang Anda minati.
Kunjungi GitHub