JavaScript Embed

Age Verification for Any Website

Not on WordPress? No way to access an API? No problem. Add compliant age verification to any website with a single line of code. If your platform lets you paste a script tag, it works.

Works With Your Platform

Our JavaScript embed works on any website that allows custom HTML or script tags. No server-side code required—just paste and go.

🟦

Wix

Squarespace

🔷

Webflow

🛒

Shopify

📄

Static HTML

🌐

Any CMS

If you can add a <script> tag to your pages, you can add age verification.

One Line of Code

The entire integration is a single script tag. Add it to your site's HTML and age verification is live. No build tools, no dependencies, no backend changes.

Loads asynchronously—won't slow down your page
Automatically detects mobile vs. desktop
Lets verified bots (Googlebot, etc.) through automatically
Configurable cookie lifetime (default: 1 year)
Add to your HTML <body>
<script src="https://age-verify.xyzinc.com/embed.js"
        data-site-key="pk_live_your_key_here"></script>
Optional attributes
data-cookie-days="365"   
data-mode="auto"         

How It Works

Four steps from signup to live age verification on your site.

1

Sign up for a Pro account

Contact us and we'll set you up with a Pro account and access to the admin dashboard. You'll get your publishable site key during onboarding.

2

Configure your regions

In the admin dashboard, define which regions require verification and what tier (face check, ID verification, or block). Visitors from unregulated regions pass through without interruption.

3

Add the script tag

Paste the embed snippet into your site's HTML. On most platforms this is done through a "Custom Code" or "Header/Footer Scripts" setting. No coding experience needed.

<script src="https://age-verify.xyzinc.com/embed.js" data-site-key="pk_live_..."></script>

You're live

Visitors from age-gated regions see a verification overlay. After verifying, a cookie is set and they browse freely. Returning visitors are recognized instantly.

What Your Visitors See

The embed creates a clean, full-page overlay that blocks content until verification is complete.

🛡️

Overlay Appears

Page content is hidden behind a clean white overlay with a "Verify My Age" button.

📱

Verification Opens

On desktop, a popup window opens. On mobile, the user is redirected to complete verification.

Verified

After completing the check, the overlay disappears and a cookie is set for future visits.

🔄

Returning Visitors

The cookie is checked on load. Verified visitors see your site immediately—no overlay, no delay.

Search engine crawlers (Googlebot, Bingbot, etc.) are automatically allowed through—no impact on SEO.

JS Embed vs. WordPress Plugin

The right choice depends on your platform. Both use the same verification engine and privacy protections.

JS Embed

Best for sites where you can't run server-side code.

  • Works on any platform
  • Single script tag integration
  • Your site doesn't need Cloudflare
  • Geo detection via our Cloudflare-protected API
  • Client-side only (requires JavaScript)
  • No fail-closed option
WordPress Plugin

Deeper integration for WordPress sites with server-side enforcement.

  • Server-side enforcement via MU-plugin
  • Fail-closed behavior option
  • Cloudflare geo headers for faster detection
  • Free plan available (100 credits/month)
  • In-plugin region and verification management
  • Test mode for simulating regions
Learn more about the WordPress plugin

Honest Expectations

The JS embed is a powerful tool, but it operates within the constraints of client-side code. Here's what you should know.

JavaScript Required

The overlay runs in the browser. A technically savvy user could disable JavaScript to bypass it. This provides a strong compliance posture—demonstrating that you have age verification in place—but it is not an absolute block. For server-side enforcement, consider the WordPress plugin or a custom API integration.

Geo Detection Via Our API

When the embed calls our API, the request passes through our Cloudflare-protected infrastructure, which provides accurate geo headers. Your site itself does not need Cloudflare. Visitors using VPNs may appear to be in a different region.

Bot Detection

The embed identifies common search engine crawlers by User-Agent and lets them through automatically so your SEO is not affected. This covers all major search engines.

Technical Requirements

The JS embed is designed to work with minimal requirements. No server-side setup, no DNS changes, no Cloudflare.

  • HTTPS — Required for secure cookie handling. Most platforms provide this by default.
  • Custom code support — Your platform must allow adding custom <script> tags.
  • Modern browsers — Uses the Fetch API and modern JavaScript. All current browsers are supported.
Your site doesn't need Cloudflare. Geo detection happens when the embed calls our API, which is behind Cloudflare. Your site can be hosted anywhere.

Where to Add the Code

Wix

Settings → Custom Code → Add Code → Body (end)

Squarespace

Settings → Advanced → Code Injection → Footer

Webflow

Project Settings → Custom Code → Footer Code

Shopify

Online Store → Themes → Edit Code → theme.liquid (before </body>)

Static HTML

Add the script tag before </body> on every page that needs age gating

Ready to Add Age Verification?

The JS embed is available as part of a Pro account. Contact us to get started—we'll walk you through the setup and have you live in minutes.

On WordPress? Get the free plugin instead—100 credits/month, no credit card required.