Site access - Add age verification to your online store

Topic summary

A tutorial explains how to add age verification to Shopify stores selling age-restricted products like alcohol or tobacco. The implementation uses a custom snippet that displays a popup requiring visitors to confirm their age or enter their birthdate.

Key Implementation Details:

  • Creates an age-check snippet in the theme’s Snippets folder
  • Sets a cookie (isAnAdult) that prevents re-prompting for 2 weeks
  • Supports both simple yes/no verification and date-of-birth picker options
  • Includes fallback for users with JavaScript disabled

Common Issues Reported:

  • Mobile display problems: Popup appears overly zoomed or as a grey page on mobile devices
  • Age calculation bug: Date-of-birth verification incorrectly requires users to be 1 month older than the specified age threshold
  • Theme editor interference: Age verification popup blocks the Shopify theme customization preview screen and won’t dismiss when clicking Enter/Exit buttons
  • Cookie persistence: Users want options to show the popup on every visit rather than storing the 2-week cookie

Customization Requests:

  • Applying verification to specific collections/pages instead of the entire site
  • Removing background for SEO purposes (transparent overlay)
  • Styling modifications for buttons and text alignment

Important Caveat: This method does not meet FDA regulatory requirements for tobacco/e-cigarette sales and relies on user honesty.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

Has anyone been able to figure out how to apply the age verification to a collection rather than the entire page yet? If so, can someone please help me with the coding information and format??