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. Already gate on your own server? Connect the two
If your backend also checks age, the two gates can’t see each other by default — your server records the pass in an httpOnly cookie our script can’t read, and we record ours in the browser where your server can’t read it. The visitor gets asked twice. Two optional attributes fix that. Both are opt-in: leave them off and nothing about your gate changes.
<script src="https://verisdiction.com/v1/gate.js"
data-site="vd_yoursite"
data-pass-marker="my_pass_lvl"
data-sync-url="/api/age/sync"></script>data-pass-marker— name a readable cookie your server sets once it has accepted this visitor’s age. The value is the assurance level:0= 18+ confirm,1= age estimation,2= government ID. We read it and stay silent whenever it already meets what the visitor’s jurisdiction requires. Set it alongside whateverhttpOnlycookie you already use — this one carries no secret, only the level.data-sync-url— a path on your own site. Whenever someone passes the gate here wePOST{ lvl, exp, proof? }to it with their cookies attached, so your server can record the pass and stop asking. That fires on the 18+ confirm, on a completed verification, and when we accept a visitor’s existing Verisdiction Pass. Theproofkey is only present when a real verification produced one — validate it server-side before granting a gov-ID-level pass, and check that itsaudis your own site id and that it is not markedsimulated. Never trust a level the browser claims on its own.
Visitors who passed before you added this are migrated automatically: on their next page load we tell your endpoint once about the pass they already hold. That message carries no proof (we never stored one), so a gov-ID state should correctly refuse it and make them verify for real. Setting the marker cookie is what ends the migration — once we can see it, we stop. If you refuse the migration instead (any error, or a success that sets no cookie), we remember that for the visitor’s session and don’t ask again in that tab.
Two deliberate limits. The pass marker never lifts a blocked-region screen — a region being off-limits isn’t a question about the visitor’s age. (data-bypass-cookie, the staff/reviewer override, does skip every tier; that’s what it’s for.) And Verisdiction.passed(), if you call it from your own code, tells you the level this browser holds — including from the marker — not whether the region is allowed, so keep applying your own region rules there. Like anything in a browser, the marker can be faked by the visitor: it only silences our modal. Your server stays the thing that actually enforces access.
7. 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.