重要事項:本文件不適用於您目前選取的格式 廣告!
amp-access-poool
說明
顯示 Poool 付費牆。
必要指令碼
<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>
用法
amp-access-poool
元件基於 amp-access
,使用您 Poool 控制面板組態中的 bundleID
來載入並顯示付費牆。
詳情請參閱 poool.tech。amp-access-poool
基於 amp-access
並需要此元件。
如果您熟悉 Poool 在 AMP 以外的運作方式,您會知道在這裡無法使用 excerpt
和 hide
模式。這是因為 AMP 的特定行為所致。您將能夠使用 amp-access
提供的 access
變數來鎖定或解鎖您的內容。請查看下方的 poool-widget
區段。
amp-access-poool
元件不需要授權或回傳組態,因為它已預先設定為可與 Poool 搭配使用。
如需模式的更多資訊,請查看我們的 SDK 文件。
組態
您必須在 AMP 中以 camelCase 設定組態屬性,而不是 Poool 傳統上使用的底線 (" _ ") 符號。
例如:使用 customSegment="amp-custom-segment"
以達到 poool("config", "custom_segment", "amp-custom-segment");
的效果。
HTML 區段
設定 poool-widget 區段,其中包含未授予存取權時的 Poool 付費牆。
amp-access-poool
元件需要 3 個不同的區段
- 文章預覽,在尚未授予存取權時顯示(使用
amp-access="NOT access"
),並由 Poool 使用poool-access-preview
屬性識別 - 文章內容,在授予存取權時顯示(使用
amp-access="access"
),在授予存取權之前由amp-access-hide
屬性隱藏,並由 Poool 使用poool-access-content
屬性識別 - Poool 的付費牆容器,在尚未授予存取權時顯示(使用
amp-access="NOT error AND NOT access"
),並由 Poool 使用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
範例:基本付費牆組態(使用預設值)
組態與 AMP Access 類似,只是不需要授權、回傳或登入網址。
<script id="amp-access" type="application/json"> { "vendor": "poool", "poool": { "bundleID": "Your app id provided by poool", "pageType": "premium", "itemID": "amp-example-article" } } </script>
範例:為自訂群組/區隔中名為「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>
如需組態變數的更多資訊,請查看我們的 SDK 文件。
屬性
bundleID (必填)
您的應用程式 ID(您可以在控制面板上找到)。
itemID (必填)
您的唯一文章 ID。
pageType (必填)
用於告知 Poool 目前使用者已瀏覽過頁面。請參閱 文件 以取得更多資訊。
debug
啟用/停用偵錯模式。請參閱 文件 以取得更多資訊。
forceWidget
覆寫使用者的目前小工具。請參閱 文件 以取得更多資訊。
loginButtonEnabled
啟用/停用付費牆「登入」按鈕。請參閱 文件 以取得更多資訊。
signatureEnabled
啟用/停用付費牆簽名,在文章解鎖時顯示在文章內容下方。請參閱 文件 以取得更多資訊。
videoClient
設定影片小工具的預設影片用戶端 (vast, googima)。請參閱 文件 以取得更多資訊。
customSegment
使用自訂群組/區隔 slug 覆寫原生區隔。請參閱 文件 以取得更多資訊。
cookiesEnabled
根據最新的 GDPR 規範,我們決定預設停用付費牆內的 Cookie。您必須明確設定此屬性以反映使用者的同意。請參閱 文件 以取得更多資訊。
locale
設定付費牆內所有文字的預設語言環境。請參閱 文件 以取得更多資訊。
context
使用自訂內容值覆寫預設或原生內容。請參閱 文件 以取得更多資訊。
驗證
請參閱 AMP 驗證器規格中的 amp-access-poool
規則。
您已經閱讀本文件十幾次,但它似乎沒有涵蓋您的所有問題?也許其他人也有同樣的感受:在 Stack Overflow 上與他們聯繫。
前往 Stack Overflow 發現錯誤或缺少功能?AMP 專案強烈鼓勵您的參與和貢獻!我們希望您能成為我們開放原始碼社群的長期參與者,但我們也歡迎您針對您特別感興趣的問題做出一次性的貢獻。
前往 GitHub