A free age gate for any website
Make a pop-up that asks visitors to confirm their age before they see your site. Choose a date-of-birth box or Yes and No buttons, add your logo and colors, and paste one script tag into your site. There’s no account and no key, and what visitors enter stays in their browser.
A gate asks; it doesn’t check. Anyone can click Yes or type a date, so the answer is a self-confirmation, not age verification.
By Navexa Updated First published Checked in full on How we check facts
Make your age gate
Choose how visitors answer and how the gate looks. The preview and the code update as you type.
Preview
The preview loads in your browser.
A picture of your gate, run by the real gate script; it can’t be clicked here.
<!-- Age gate by Navexa: https://navexa.co/age-verification/age-gate -->
<script
src="https://verify.navexa.co/js/agecheck-gate-1.0.0.js"
integrity="sha384-YlCh06ZOx6aot0PQw52J0tvI0PRkqXvQFqtlneZ6YartxcH4uY8fj37ntKwjwlej"
crossorigin="anonymous"
data-navexa-gate
data-mode="dob"
data-min-age="21"
data-remember-days="30"></script>Version 1.0.0 of the gate script, locked with an integrity hash: browsers run exactly this file or nothing. To update, make a new tag here and replace the old one.
Paste the code into the <head> of every page you want covered, as high
as you can, and don’t add async or defer.
Where to paste it
Paste the tag into the <head> of every page you want covered, as high as your
site builder allows. Most builders have a setting for code in the header; the table says where
it is in six of them. Some allow custom code only on paid plans, so check yours first. The
Squarespace and Webflow help pages in the table say which plans can add it. Wix asks for a
connected domain, and connecting a domain needs a paid Premium or Studio plan.5 On WordPress.com, installing a plugin such as WPCode needs a paid plan.9 If your site sends a Content-Security-Policy, add https://verify.navexa.co to its script-src.
| Site builder | Where the tag goes |
|---|---|
| Shopify | In Online Store, open your theme’s ⋯ menu and choose Edit code. Open layout/theme.liquid and paste the tag on the line after <head>. Shopify’s code editor underlines the tag in red as a parser-blocking script. Leave it as it is, without async or defer, so the gate covers the page before it shows.12 |
| BigCommerce | Storefront › Script manager › Create a script. Set the placement to the header and the location to Storefront pages, choose to enter the script yourself rather than a URL, and paste the tag.3 |
| Wix | Settings › Custom Code (under Development & integrations) › Add Custom Code. Paste the tag, choose All pages, load it on each page, and place it in Head. Wix asks for a published site with a connected domain first.4 |
| Squarespace | Open the Code Injection panel and paste the tag into Header, which every page gets.6 |
| Webflow | Site settings › Custom code. Paste the tag into Head code, save, then publish the site.7 |
| WordPress | Install a plugin that adds code to every page’s header, such as WPCode, and paste the tag into its header box. On a WooCommerce store, Navexa AgeCheck for WooCommerce can show the same gate instead, with no Navexa account or API key: in WooCommerce › Settings › AgeCheck, set Age verification to “Off: entry age gate only”, then turn the gate on under Entry age gate.810 |
| Any other site | Paste the tag into the <head> of every page, or of the template they share, before other scripts. |
Then open your site in a private window, where nothing is remembered, and you’ll see the gate as a new visitor does. Builders handle scripts in their own ways, so look before you rely on it.
What the gate does, and what it doesn’t
It does:
- Cover each page the tag is on until the visitor answers. Your page stays hidden behind the backdrop, and nothing on it moves.
- Ask for a date of birth (month, day and year) or a Yes or No, and compare the date with your minimum age of 18, 19 or 21, in the visitor’s browser.
- Remember a Yes in that browser for the days you choose, or only in the tab where the visitor answered. If you raise the minimum age, everyone is asked again.
- Send under-age visitors to your exit page, or show them a message.
- Let major search engine crawlers through, such as Googlebot and Bingbot, by their user agent, so search engines can still read your pages.
- Show as a labelled dialog that can be answered with a keyboard alone; focus stays inside it until the visitor answers.
It doesn’t:
- Look at an ID or any records. Anyone can click Yes or type an earlier year.
- Send an answer or a date of birth to Navexa or anyone else, or store the date of birth.
- Set a cookie.
- Run when JavaScript is off or the script can’t load from verify.navexa.co. Those visitors see your site without it.
- Stand in for an age check at checkout. For that, there’s Navexa AgeCheck.
A gate or an age check?
| Free age gate | Navexa AgeCheck | |
|---|---|---|
| The visitor | Clicks Yes or types a date of birth | Takes a data check (name, date of birth and home address, with no ID upload) or a photo ID and selfie check |
| What you get | Their word: a self-confirmation | A passed or failed verification |
| Before you ship | Nothing to ask | A clearance answer for each order, before you buy the label |
| Account | None | Sign up, with a card for live checks |
| Price | Free | $0.49 per passed check, $0.10 when a repeat buyer is cleared by an earlier pass. No monthly fee. Failed, abandoned and expired checks are free. |
Navexa AgeCheck is sold on its own. Sign up for Navexa AgeCheck, or read how it works.
What visitors’ browsers send
To show the gate, a visitor’s browser downloads the gate script from verify.navexa.co, which Cloudflare delivers. Like any file a website loads, that request carries the visitor’s IP address, browser details and your site’s address. Navexa’s own server writes no log line for a download unless the download fails. It does send about one in ten of the downloads that reach it, with the request’s browser details, to Sentry, the error-monitoring service Navexa uses. The script sends nothing back.
In the visitor’s browser, the gate keeps a Yes as two values, when they answered and the minimum age, in local storage. When you remember a Yes only in the tab where the visitor answered, it uses session storage instead, which belongs to that one tab. Your logo loads from your own site. The privacy policy covers the gate and this page.
Questions
- Is this age verification?
- No. The gate asks visitors their age and takes their word for it. To verify a buyer’s age at checkout, there’s Navexa AgeCheck.
- Does it cost anything?
- No, and there’s no account. Navexa AgeCheck, the age check, costs $0.49 per passed check.
- Will it slow my site down?
- The pinned script is 14.8 kB, about 6.4 kB compressed, and browsers keep it for a year once they have it. It loads before your page shows, so a visitor’s first page waits for one small download. With automatic updates on, browsers keep it for 5 minutes, then fetch it again.
- What if verify.navexa.co can’t be reached?
- Your site shows without the gate. With the integrity hash, browsers also refuse any file that isn’t byte for byte the one the tag pins, and show your site without the gate.11
- How do I change my gate?
- Make a new tag here and replace the old one. A visitor who already said Yes isn’t asked again until that Yes runs out under the new tag’s number of days, counted from when they answered. If you raise the minimum age, or switch to remembering a Yes only in the tab where the visitor answered, everyone is asked again.
- I use WooCommerce. Do I need this?
- Not if you’d rather use Navexa AgeCheck for WooCommerce. It can show the same gate from its own settings, with no Navexa account or API key: set Age verification to “Off: entry age gate only”, then turn the gate on under Entry age gate. It’s the same self-confirmation as the tag you make here.
Sources
- Editing theme code Shopify Help Center. Checked on
- Layouts Shopify developer documentation. Checked on
- Using Script Manager BigCommerce Help Center. Checked on
- Wix Editor: Embedding Custom Code on Your Site Wix Help Center. Checked on
- Connecting a domain to a Wix site Wix Help Center. Checked on
- Customize parts of your site with code injection Squarespace Help Center. Checked on
- Custom code in head and body tags Webflow Help Center. Checked on
- WPCode: Insert Headers and Footers + Custom Code Snippets WordPress.org Plugin Directory. Checked on
- Install a plugin WordPress.com Support. Checked on
- Navexa AgeCheck for WooCommerce 1.1.1 readme: using only the entry age gate Navexa, on GitHub. Checked on
- Subresource Integrity MDN Web Docs. Checked on
Change log
- Full independent review: 6 corrections. The page no longer says Navexa’s server records a download only when it fails: about one in ten downloads that reach it go to Sentry, Navexa’s error-monitoring service, with the request’s browser details. Remembering a Yes for 0 days now says it lasts only in the tab where the visitor answered. The answer on changing a tag now says that the new tag’s number of days applies to earlier Yeses, and that switching to 0 days asks everyone again. The plan note now says which builders need a paid plan. The Shopify row warns that the code editor flags the tag, and says to leave it as it is. The WooCommerce source is now the plugin’s 1.1.1 readme.
- Added the WooCommerce plugin’s gate-only setting (plugin version 1.1.0) to the WordPress row and the questions.
- First published, with version 1.0.0 of the gate.