Overview
Gated Content Overview
FanID gated content is a visual content gating system. It encourages website visitors to sign in with FanID by obscuring content behind a blur or overlay — while keeping the content in the HTML source for search engines.
How it works
- Content is rendered normally in the HTML source (the DOM)
- The FanID Widget applies a visual overlay (blur, gradient, or cover) on top of gated sections
- Visitors see a call-to-action prompting them to sign in
- After authentication, the overlay is removed and content is revealed
- Search engine crawlers see the raw HTML — they don't execute the JavaScript that applies the gate
Gated content vs. server-side authorization
| Aspect | Server-Side Auth | Gated Content |
|---|---|---|
| Content in HTML source | No — server withholds it | Yes — content is in the DOM |
| SEO indexable | No | Yes |
| Bypass difficulty | Impossible without credentials | Possible with DevTools |
| Purpose | Security | Engagement funnel |
Four ways to gate content
The SDK supports four methods, all available from day one. The first three apply a visual gate that keeps content in the DOM (good for SEO). The fourth removes content entirely on logged-out visitors (good for non-indexable UI like account links and CDN-cacheable layouts).
1. Custom Element (declarative)
Zero-configuration approach for non-technical users:
<wmt-fanid-protected>
<p>This content is gated.</p>
</wmt-fanid-protected>
See Custom Element for details.
2. Data attributes
For CMSes that strip unknown HTML tags:
<div data-fanid-gated>
<p>This content is gated.</p>
</div>
See Data Attributes for details.
3. Programmatic (JavaScript API)
Full developer control over any DOM element:
FanIDWidget.gate('#premium-stats')
See Programmatic Gating for details.
4. CSS-only soft gating
The widget sets data-fanid-authed on <body> whenever the user is signed in. Pure CSS rules can read that
attribute and show or hide elements without any JS, which keeps the page CDN-cacheable:
[data-fanid-locked] { display: none; }
body[data-fanid-authed] [data-fanid-locked] { display: block; }
See Soft Gating with CSS for details.
Ad-blocker resistance
The gating overlay uses randomized CSS class names generated at init time. Since the class names change on every
page
load, ad blockers cannot add them to static filter lists. The injected <style> tag is also monitored and re-injected
if
removed. See Ad-Blocker Resistance for the full strategy.