To launch Reader Revenue Manager for your publication, you have to set up each page on your site with a code snippet from Publisher Center. This snippet loads Reader Revenue Manager prompts on your site.
To install the snippet, you must have permission to access and edit your siteâs theme or template code in your content management system (CMS).
Add a code snippet to your site
- Go to Google Publisher Center.
- Sign in with a Google Account you use with your publication.
- Click Reader Revenue Manager.
- Click Add code snippet to your site.
- If youâve already completed your setup but havenât added the code snippet, you can access it under CMS Sync. There are 2 snippet types:
- Open access snippet:
- Use this on:
- Articles that should be open to all readers if you set up a paywall.
- All articles if you set up contributions or surveys
- Use this on:
- Product ID snippets
- On the pages you want to paywall, copy the code snippet containing the product ID you want to use.
- To set different prices for different content types, use product IDs. For example, if youâd like to sell a subscription for your news content and sports content, create 2 separate product IDs to have separate code snippets. The code snippet associated with your sports subscription is added to your sports pages. The code snippet associated with your news subscription is added to your news pages.
- Open access snippet:
- Add the snippet to the
<head>
tag of each page. - To make sure Reader Revenue Manager loads properly, go to your website.
Tips:
- If you make an update to your price with a new product ID, you must update your CMS Sync on your website.
- If you have multiple plans active on a single site, you must configure multiple snippets and add each snippet to the relevant content pages. One snippet per page:
- Configure one snippet for each product ID.
- Include these product IDs on the:
- Relevant pages
- Templates within your CMS
Glossary
Fields
clientOptionsThe clientOptions
attribute accepts an Object where you can specify theme and language. If you donât specify a language value, it defaults to your Publisher Center settings. Language codes for this attribute follow ISO 639-1 format.
- For theme: Specify âlightâ or âdark.â
- For
lang
: Specify the language code, such as âen.â
To specify the pricing plan you want to configure for your page, use the isPartofProductID
attribute. This attribute follows the syntax of <PUBLICATION_ID>:<PRODUCT_ID>
. You can find your product ID in Google Publisher Center.
To make sure the snippet loads correctly on the page, set the pricing plan to âlive.â
The isPartOfType
attribute accepts an array of strings. When you copy the code snippet, the default value for this attribute is set to ["Product"]
.
The type property should fall in line with structured data markup schema. For news publications, use NewsArticle
â more information is available on Schema.org.
Example code snippet
JavaScript
<script async type="application/javascript"
src="https://news.google.com/swg/js/v1/swg-basic.js"></script>
<script>
(self.SWG_BASIC = self.SWG_BASIC || []).push( basicContributions => {
basicContributions.init({
type: "NewsArticle",
isPartOfType: ["Product"],
isPartOfProductId: "<PUBLICATION_ID>:<PRODUCT_ID>",
alwaysShow: true,
clientOptions: { theme: "light", lang: "en" },
});
});
</script>