Guide
How to add an age verification popup on Shopify
27 November 2026
A Shopify age check can be one snippet in the theme, with no app and no account. The popup asks the visitor to say they are old enough, or to enter a date of birth. It does not look at an identity document, and this page is not legal advice. Check what the law asks of your shop and your products before you rely on a popup.
What the popup checks
The Age Gate Builder builds that snippet in the browser. You set a minimum age from 1 to 99. The form starts at 18. Visitors answer with Yes and No buttons, or by entering a date of birth. A date of birth is used once, in their browser, to work out the age. It is not written into the cookie.
You can tell the popup to remember a pass for 0 to 365 days. The builder's own page says that 0 asks again each time the browser is reopened. A pass stores one cookie, agb_pass, with the value 1, on the visitor's browser for your site (path=/, SameSite=Lax). When the day count is above 0, the cookie also gets a max-age of that many days times 86400 seconds. The cookie does not come back to this site.
An optional address is where a "no" goes. Leave it empty and the visitor stays on the popup with your "not old enough" text. The address has to be an http or https URL, or a path on your own site such as /somewhere. Anything else is dropped.
Write {age} in the title, the message or a button where the minimum age should appear. The builder replaces it with the number you set. Empty text falls back to the builder's own sentences, including "Are you {age} or older?"
Where it goes in Shopify
The builder's page gives these steps. Menu names change; the idea is one paste into the layout every page uses, just before </body>.
- Online Store, then Themes.
- On your current theme open the "..." menu and choose Edit code.
- Open
layout/theme.liquid. - Paste the snippet on the line just above
</body>and save.
To test it, open the shop in a private window. To see the popup again after a pass, delete the agb_pass cookie or use a new private window.
Suggestion lists for this phrase also include a Shopify app, a theme and a template, and "shopify age verification popup free". The builder is the free snippet: no app to install, no account and no monthly fee. The free snippet shows a small "Age gate by Age Gate Builder" link back to the builder page. That link is ordinary text in the popup. The popup does not call this site when it runs.
The same snippet has paste steps for WooCommerce, Squarespace, Webflow and any other site. Those are on the builder page. How to add an age verification popup on WooCommerce follows the WooCommerce steps. What an HTML age verification popup contains describes the block itself.
What the builder records
Opening the builder sends a page view to this site. Pressing Copy the snippet sends a product use, because that button is marked for it. Both go out as a beacon (POST /api/t) with the page address, the site that linked here, a campaign tag if the link had one, and a width class: under 640 pixels, under 1024, or wider. The beacon does not include the words you type. Scrolling records depth at 25, 50, 75 and 100 percent. A click records where it landed, as percentages, plus the element's tag, id or class, and not the text. If the browser sends Do Not Track or Global Privacy Control, the script stops before sending, and the server drops a beacon that still arrives with that signal. The privacy page is the full account.