Developer Hub

Publisher Monetization Examples for gvm.js

Production-minded strategy templates for paid content, downloads, redirects, and inline premium modules.

Use these examples to launch faster, test conversion safely on real traffic, and adapt paywall UX to your editorial product.

Baseline setup: Every example uses the same body-level gvm bootstrap and highlights only the strategy-specific data-gvm-* attributes.

Paywall Templates · 7 concepts

Seven paywall layouts, one data-gvm API

Seven different data-gvm-template="paywall" concepts, all pure HTML + CSS. Every demo runs in data-gvm-env="demo", so you can click through the full payment flow without any real charge.

Pick a layout, open the page, try the unlock. Each demo locks the same premium article copy — five with the blur strategy, the inline card with hide — only the paywall template differs.

How it works: every concept page declares a paywall template (injected into body or #article) and a payment template (dialog). The premium part is gated with data-gvm-hide-strategyblur for the fixed layouts, hide for the inline card. Switching layouts is a pure template/CSS change, no strategy or backend tweaks.

Overlay · gvm-overlay.js

Config-driven paywall demo

Prices and blocking rules come from a static JSON config — the article only marks its content with a single data-gvm-reference.

Loading gvm-overlay.js (instead of gvm.js) turns on overlay mode; the config URL is derived from data-gvm-env + data-gvm-tenant. Long-form editorial demo articles with inline SVG image placeholders, editable in-page via ?gvm_admin=1.

No-flash pattern: each article wraps its gated body in .gvm-cloak (rule declared in <head>) so the paywalled content stays invisible until the overlay has booted gvm.js.