如要實作訂閱連結功能,發布商網站必須使用用戶端 JavaScript 為讀者啟動連結,並使用伺服器端服務管理讀者的授權。這兩個系統都會使用代管網頁、刊登內容的發布中心設定,以及 Google Cloud 服務帳戶資訊中的資訊。
逐步說明如何連結訂閱項目
付費訂閱或捐款權限的讀者造訪你的網站。
您的用戶端程式碼會使用 swg.js,讓讀者有機會將自己的帳戶連結至 Google 帳戶,以便透過您設計並放置在網站上的按鈕或行動號召,獲得關聯的優惠。
觸發動作 (透過點擊明確觸發,或透過其他動作或狀態間接觸發) 後,讀者會登入 Google 帳戶 (或從已啟用的帳戶中選取),並授予發布商權限,將讀者資訊與其 Google 帳戶建立關聯。發布商會為讀者建立發布商提供的 ID (PPID),做為要求的一部分,並將其儲存在讀者的 Google 帳戶中,用於後續的 API 互動。
授權後,讀者會被送回發布者的網站。發布商現在可以讓 Google 知道讀者有哪些授權。
(非同步) 發布商會針對已成功連結帳戶的每位讀者,使用其 PPID 傳送 Google 資訊,以更新 Google 的 PPID 授權記錄。Google 的 PPID 授權記錄必須保持最新狀態,因為這些記錄會在過期後遭到刪除。記錄會在到期日後 30 天過期,並隨後清除。
優點
當讀者造訪已整合 Subscription Linking 的發布者網站,並在該網站上付費訂閱或捐款時,讀者就能將發布者帳戶連結至 Google 帳戶。這些讀者之後就能在 Google 產品 (例如 Google 搜尋和 Google 探索) 中,看到更多來自這家出版商的內容。這樣一來,讀者就能盡情享用已付費的出版品內容。讀者隨時可以取消連結自己的出版商帳戶與 Google 帳戶,或透過出版商提供的動作取消連結。
讀者福利摘要
讀者搜尋任何內容 (新聞或非新聞) 時,會看到「來自訂閱項目」清單。
讀者可透過 Android 主畫面、iOS 版 Google 應用程式、Chrome 或主畫面小工具與「探索」互動,並在「探索」中看到「來自訂閱項目」專區。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-25 (世界標準時間)。"],[],["Publishers implement Subscription Linking using client-side JavaScript and a server-side service. Readers link their publisher account to their Google Account via a call-to-action, granting permission and creating a publisher-provided identifier (PPID). Publishers then update Google with the reader's entitlements, tied to the PPID. This process enables readers to see content from their subscriptions in Google Search and Discover. Publishers benefit from a streamlined account management system and improved user engagement. Records become stale 30 days after the expiration date.\n"]]