Tutorial
How to add your age gate — step by step
You install Verisdiction by adding one line of code to your site, once. Below is exactly how to do it on every major platform, plus real examples for gating specific pages and actions. No coding experience needed.
1. The one line
This is the whole install. Get your version (with your real site ID) from your dashboard — it looks like this:
<script src="https://verisdiction.com/v1/gate.js" data-site="vd_yoursite"></script>
Replace vd_yoursite with your actual ID from the dashboard. That one line knows the law in every location and shows the right check automatically.
2. Add it on your platform
WordPress
- In your WordPress admin, the easiest way is a header-snippet plugin like “WPCode” or “Insert Headers and Footers.”
- Install it (Plugins → Add New → search the name → Install → Activate).
- Open its settings and paste the snippet into the “Footer” (or “Body”) box. Save.
That's it — every page is now covered. (Theme editors: you can also paste it just before </body> in footer.php.)
<script src="https://verisdiction.com/v1/gate.js" data-site="vd_yoursite"></script>
Shopify
- From your admin: Online Store → Themes → ⋮ → Edit code.
- Open Layout → theme.liquid.
- Paste the snippet right before the closing </body> tag. Save.
Covers your whole storefront. Great for age-restricted products (vape, alcohol, cannabis).
Wix
- Settings → Custom Code → + Add Custom Code.
- Paste the snippet, set “Place Code in” to Body – end, and apply to All pages. Save.
Squarespace
- Settings → Advanced → Code Injection.
- Paste the snippet into the Footer box. Save.
Webflow
- Project Settings → Custom Code.
- Paste the snippet into the Footer Code box. Save → Publish.
Google Tag Manager
- New Tag → Custom HTML.
- Paste the snippet into the HTML box.
- Trigger: All Pages (or only the pages you want gated). Save → Submit.
Best if you already run GTM — no site-file editing at all.
React / Next.js
- Add it once in your root layout so it loads on every page.
// app/layout.js — inside <body> import Script from "next/script"; <Script src="https://verisdiction.com/v1/gate.js" data-site="vd_yoursite" strategy="afterInteractive" />
Plain HTML (any site)
Paste the line just before the closing </body> tag of your pages:
<body> <!-- your page content --> <script src="https://verisdiction.com/v1/gate.js" data-site="vd_yoursite"></script> </body>
3. Gate only specific pages
By default the gate runs everywhere the line loads. To gate only certain pages (e.g. just your shop or premium area), add data-trigger="paths" and list the path prefixes:
<script src="https://verisdiction.com/v1/gate.js"
data-site="vd_yoursite"
data-trigger="paths"
data-paths="/shop,/premium"></script>4. Gate on an action (checkout, login, etc.)
Want the check to fire at a specific moment — like the first time someone buys credits or logs into a premium area — instead of on page load? Set the trigger to manual and call it from your own button/event:
<script src="https://verisdiction.com/v1/gate.js"
data-site="vd_yoursite"
data-trigger="manual"></script>Then, in your checkout or login code:
// run the age check at the right moment: Verisdiction.gate(); // helpers: Verisdiction.passed(); // -> assurance level if already verified Verisdiction.reset(); // clear the stored pass (e.g. on logout)
5. Real-world examples
📹 Adult creator site on WordPress
Goal: gate the whole site; verification appears automatically only in states/countries that require it; nowhere else.
- Install the "WPCode" plugin.
- Paste your one line into its Footer box. Save.
- Done. A visitor from Texas gets a gov-ID check; a visitor from a no-law state sails through.
🛒 Vape shop on Shopify
Goal: only gate the checkout, not the whole catalog.
- Edit code → theme.liquid.
- Paste this before
</body>:
<script src="https://verisdiction.com/v1/gate.js"
data-site="vd_yoursite"
data-trigger="paths"
data-paths="/checkout,/cart"></script>💳 Membership platform — gate on first purchase
Goal: don't interrupt browsing; verify age the first time someone adds funds.
<!-- in your layout -->
<script src="https://verisdiction.com/v1/gate.js"
data-site="vd_yoursite" data-trigger="manual"></script>
<!-- in your "Add funds" button handler -->
<script>
addFundsButton.addEventListener("click", function () {
Verisdiction.gate(); // age check fires here
});
</script>6. Test it before you go live
- Use the Open live test button in your dashboard to preview your branded gate and jump between states.
- Add
?vdtest=1to a URL withdata-mode="test"to trial it on a live page without affecting real visitors. - You can even complete a real age check yourself to see the whole flow end to end.
Email help@verisdiction.com — we'll get you live. Back to the Help center.
Verisdiction provides recommended settings informed by counsel. You control your configuration and are responsible for your own compliance. Informational only — not legal advice.