Shopify age verification popup generator
Last updated
One click and a working gate appears below. The wording and the age in it are ours to begin with; set your own in step 2.
Pick one of the three designs above. The gate, running over a placeholder store, and the code you paste both appear here.
Settings behind the gate
A Shopify age verification popup is a full screen overlay that asks visitors to confirm they are old enough before they browse, and this generator writes one as HTML, CSS and a short script for theme.liquid; it is a click-through question that remembers the answer, not a check of how old anyone actually is.
A click-through gate is not age verification and this page is not legal advice. Nothing here checks identity or age, and nothing here tells you what the law requires for your products. Age gates are not a Nudgesmart feature; this is a free snippet.
Read the first caveat below before anything else. The settings decide how the question looks and how long the answer is remembered; none of them turns it into a real check.
- Minimum age
- A whole number from 13 to 25. Type [age] in the heading, message or buttons and the number is written in for you, so changing it once changes every mention.
- Yes and No
- Yes closes the overlay and remembers the answer. No sends the visitor to the leave address you set, or, with none set, shows your message and keeps the store covered.
- Leave address
- Where No goes. Only a full https address or a path starting with a single slash is accepted. Anything else, including script addresses, is refused and reported rather than written into your theme.
- Remember for
- How many days, up to 365, before the same browser is asked again. A larger number is capped, and the generator says so. Zero asks once per browser session. The answer is kept in the shopper’s browser only; nothing is sent anywhere, and a cleared browser or a private window is asked again.
- Overlay
- A darkened layer over the whole page with the question card in the middle. The page underneath stops scrolling while it is open, and the Yes button takes keyboard focus so the gate can be answered without a mouse. The Tab key stays inside the card, and the Escape key does not close it.
Nudgesmart is available on the Shopify App Store. Browse the template library or see what it costs.
Four gates, and what the generator does with each
Invented stores. The wording after the age is filled in, how long it is remembered and every refusal come from the same function the generator runs.
| Scenario | Heading, as shown | Remembered | When No is clicked | What the generator says |
|---|---|---|---|---|
| Wine shop, remembered for 30 days | Are you 21 or older? | 30 days | Leaves for the address set | Nothing to flag |
| Vape accessories, asked once per session | This store is for adults | This session | Shows the message | Remember is zero, so the question comes back every time the shopper opens the store in a new tab or window. |
| A leave address the generator refuses | Are you 18 or older? | 7 days | Shows the message | The leave address was refused: only an https address or a path starting with a single slash is accepted. The No button shows your message instead. |
| Minimum age outside the range | nothing | — | — | Enter a minimum age between 13 and 25, in whole years. |
What an age gate does not do
It is not age verification, and it is not legal advice
Anyone can click Yes. The popup checks no ID, no date of birth and no document, and it cannot tell a sixteen year old from a sixty year old. If the law where you sell requires real age checks for your products, at checkout or on delivery, this does not meet that requirement. Take advice for your products and your markets.
Checkout is outside your theme
The gate runs on pages that use your theme layout. Shopify checkout is not one of them, and a direct link to checkout skips it. If an age confirmation is needed at the point of sale, it has to be handled in checkout or on delivery.
Search engines still read the page
The overlay covers content visually; the product pages underneath are in the HTML as normal. That keeps your store in search results, and it also means the gate is not a way to hide anything.
A cleared browser is a new visitor
The answer lives in the shopper’s browser. Private windows, cleared site data and a second device all see the question again, which is the right behaviour for a gate that remembers nothing about who clicked.
Age verification popup questions
How do I add an age verification popup to Shopify?
Duplicate your theme, open Edit code on the copy, and paste the generated block into layout/theme.liquid directly after the opening body tag. It then covers every page that uses the main layout, with no app installed.
Does this verify a shopper’s age?
No. It asks a question and trusts the answer. Anyone can click Yes. It is a courtesy and a signal about who your store is for, not a check of identity or age, and it is not legal advice about what your products require.
How long is the answer remembered?
For the number of days you set, in the shopper’s browser. Set zero to ask once per browser session instead. Nothing leaves the browser, so a new device or a private window is asked again.
What happens when someone clicks No?
They are sent to the leave address you set. With no address set, your message appears on the card and the store stays covered for that visit.
Will the popup hurt my search rankings?
The content underneath stays in the page, so search engines can read it. The overlay is drawn by the browser on top of the page, and a crawler reads the HTML beneath it.
Is anything sent to Nudgesmart when I use this?
No. The code is written in your browser and the preview runs in a sandboxed frame on this page. Nothing you type is stored or sent.
The gate asks one question. The visit is everything after it.
Nudgesmart builds on-site popups from ready-made templates, grouped by industry and campaign type. It does not provide age gates.