Age Gate
The VerifyHuman Age Gate prevents underage visitors from accessing restricted content on your Shopify store. It displays a full-screen overlay requiring visitors to confirm their age before they can view products or pages.
How It Works
When a visitor lands on a page protected by the age gate:
- A full-screen overlay blocks the page content.
- The visitor enters their date of birth (MM/DD/YYYY format).
- If the visitor is below the minimum age, they are redirected to a configurable URL (default: google.com).
- If the visitor meets the age requirement:
- With selfie required: The visitor proceeds to a camera step where they take a selfie for AI-based age estimation via the VerifyHuman API.
- Without selfie (attestation only): The visitor's self-declared age is accepted and recorded as an attestation. No API key is required for this mode.
- On success, the overlay is removed and the visitor can browse freely for the configured session duration.
Session Persistence
- Guest Mode (default): Verification is stored in the browser's
sessionStoragewith a configurable expiration (default: 24 hours). Closing the browser tab clears the verification. - Profile Mode: Reserved for future use. When selected, the age gate currently behaves the same as Guest Mode. A future update will add persistent verification tied to customer accounts.
Rate Limiting
The age gate enforces a maximum of 5 verification attempts per hour. If a visitor exceeds this limit, they see a "Too Many Attempts" message and must wait before trying again.
Trigger Modes
The age gate supports four trigger modes, configured in the Shopify Theme Editor:
All Pages (Entire Store)
Every page on the store shows the age gate overlay.
- Setting value:
all_pages - Best for: Stores that exclusively sell age-restricted products (e.g., an online liquor store).
Product Tag
The age gate appears only on product pages where the product has a specific tag.
- Setting value:
product_tag - Default tag:
age-restricted - Tag matching: Case-insensitive. A product tagged
Age-RestrictedorAGE-RESTRICTEDwill match. - Best for: Stores with a mix of regular and age-restricted products.
Collection Tag
The age gate appears on collection pages and product pages when the product belongs to a tagged collection.
- Setting value:
collection_tag - Default tag:
age-restricted - How it works: The Liquid template checks
collection.all_tagson collection pages, and iterates throughproduct.collectionson product pages to find any collection with the matching tag. - Best for: Organizing age-restricted products by collection rather than individual tags.
Specific Page Handles
The age gate appears only on pages whose handles match a comma-separated list.
- Setting value:
specific_pages - Configuration: Enter page handles separated by commas (e.g.,
about-us, contact). - How it works: Compares the current
page.handleortemplate.nameagainst the list. - Best for: Restricting specific informational pages.
Theme Editor Settings
All settings are configured in the Shopify Theme Editor under VerifyHuman - Age Gate (an app embed block targeting the <head>).
| Setting | Type | Default | Description |
|---|---|---|---|
| Enable Age Verification | Checkbox | true |
Master toggle for the age gate |
| Apply Age Gate To | Select | all_pages |
Trigger mode (see above) |
| Product Tag | Text | age-restricted |
Tag to match in Product Tag mode |
| Collection Tag | Text | age-restricted |
Tag to match in Collection Tag mode |
| Page Handles | Text | (empty) | Comma-separated handles for Specific Pages mode |
| Minimum Age | Range | 18 |
Minimum age (18-25) |
| Use Case | Select | adult |
Industry context: Adult, Tobacco, Alcohol, Cannabis, Gambling |
| Require Selfie Verification | Checkbox | true |
Whether to require a selfie or accept attestation only |
| Session Mode | Select | guest |
Guest (session-based) or Profile (customer account) |
| Redirect URL for Underage Users | URL | https://www.google.com |
Where underage visitors are sent |
| Session Duration | Select | 24 hours |
How long verification is remembered (1h to 1 week) |
| Custom Message | Text | (empty) | Optional message on the verification overlay |
| Logo | Image Picker | (empty) | Optional logo on the verification overlay |
Dashboard Settings (Advanced Mode)
When using the VerifyHuman dashboard in Advanced Mode, additional age gate settings are available:
| Setting | Default | Description |
|---|---|---|
| Age Gate Enabled | false |
Enable/disable age verification |
| Verification Mode | guest |
Guest or Profile mode |
| Minimum Age | 18 |
Required minimum age |
| Use Case | adult |
Industry context for the age check |
| Scope | store |
Entire Store, Specific Collections, or Specific Products |
| Session Duration (Hours) | 24 |
Session validity in guest mode |
| Require Selfie | true |
Whether selfie verification is required |
| Underage Redirect URL | (empty) | Custom redirect for underage users |
| Custom Message | (empty) | Overlay custom text |
| Logo URL | (empty) | Overlay custom logo |
Verification Modes
Attestation Only (No Selfie)
When Require Selfie Verification is disabled:
- The visitor enters their date of birth.
- If they meet the minimum age, the server records an attestation.
- No VerifyHuman API key is required.
- The API response marks the verification as
mode: "attestation". - Suitable for basic compliance where self-declaration is acceptable.
Selfie Verification
When Require Selfie Verification is enabled:
- After entering their date of birth, the visitor is prompted to take a selfie.
- The selfie is sent to the VerifyHuman API (
/api/v1/verify-age/verify) along with the date of birth. - The API uses AI to estimate the person's age from the selfie.
- A VerifyHuman API key is required.
- Provides stronger assurance for compliance-sensitive industries.
UX Flow
Step 1: Date of Birth Entry
- Full-screen dark overlay with a branded card.
- Visitor enters date of birth in MM/DD/YYYY format.
- Auto-formatting inserts slashes as the user types.
- Validation checks: valid month (1-12), valid day (1-31), valid year, and real calendar date (rejects Feb 30, etc.).
- If DOB indicates underage, the visitor is immediately redirected.
Step 2: Selfie (if required)
- Camera opens with front-facing mode.
- Visitor captures a photo.
- Can retake the photo before submitting.
- Submits the selfie along with date of birth to the API.
- Shows a loading spinner during verification.
Step 3: Result
- Success: A green confirmation message appears for 1.5 seconds, then the overlay is removed.
- Failure: An error message is displayed with the option to retry.
- Blocked: If max attempts are reached, a message directs the visitor to try later or contact support.
API Endpoints
POST /api/verify-age
Called by the age gate widget to perform verification.
Request body:
{
"date_of_birth": "1990-01-15",
"selfie_b64": "<base64 image data>",
"min_age": 18,
"use_case": "adult",
"mode": "guest",
"customer_id": "optional-customer-id",
"attestation_only": false
}
Response (success):
{
"success": true,
"verified": true,
"estimated_age": 28,
"verification_id": "vh_abc123"
}
Response (attestation mode):
{
"success": true,
"verified": true,
"mode": "attestation",
"verification_id": 42,
"message": "Age attestation accepted (selfie verification not required)"
}
Testing the Age Gate
- Enable the age gate in the Shopify Theme Editor (Customize > App Embeds > VerifyHuman - Age Gate).
- Set the trigger mode to match your scenario (e.g., Product Tag mode with a test product tagged
age-restricted). - Visit the page in an incognito/private browser window to ensure no cached session exists.
- Enter a valid date of birth above the minimum age and verify the overlay is removed.
- Enter an underage date of birth and verify you are redirected to the configured URL.
- Test selfie mode (if enabled) by allowing camera access and completing the photo capture flow.
- Test session persistence by refreshing the page after successful verification to confirm the overlay does not reappear.
- Test max attempts by failing verification 5 times and confirming the blocked state appears.
Test Mode
When test mode is enabled for your shop domain, all API responses include a _test_mode: true flag. This allows you to test the full flow without affecting production verification counts. See Reviewer Test Mode for details.