Skip to main content

Create compliant, age-restricted forms and pop-ups with Dotdigital logic

Use action button and section logic in Dotdigital to control what contacts see based on their responses in pages and forms.

Bartlomiej Rekosiewicz avatar
Written by Bartlomiej Rekosiewicz
Updated this week

Public preview

This feature is currently in public preview. If you're interested in using it, contact your Customer Success representative.

This guide explains how to set up age-gating, a common requirement in regulated industries such as alcohol, tobacco, or firearms. By using logic to restrict access based on a contact’s date of birth, you can ensure that only eligible users can view or interact with sensitive content.


Use case: Age-gated opt-in

In many regions, it’s illegal to promote age-restricted products such as alcohol or tobacco—to individuals under a certain age, typically 18 or 21. For example, a wine subscription service might need to ensure that only users aged 21 and over can sign up for marketing emails or access promotional content.

With Dotdigital’s logic tools, you can enforce these restrictions directly within your Surveys, Pages, and Forms. By combining action button logic and section logic, you can:

  • Prevent underage users from opting in to marketing.

  • Display a custom message explaining why access is restricted.

These features allow you to build a seamless, compliant user experience that automatically adapts based on the contact’s age, helping you stay on the right side of regulations while maintaining a professional and user-friendly interface.


Solution overview

To create an age-gated experience, use:

  • Section logic to control which sections are shown based on the contact’s date of birth.

  • Action button logic to hide navigation buttons, such as Next or Submit, if the contact is under the required age.


Step-by-step guide to age-gating content

Already have a form?

If you've already created your form or page using Sections and buttons, skip to Step 3 to set up the logic.

Step 1: Create a new Page or Form

  1. Go to Surveys, Pages, and Forms.

  2. Select NEW SURVEY, PAGE, OR FORM and choose either a Page or a Form, depending on your use case.

  3. Select a template or start from scratch.

  4. Give your content a name and select CONTINUE.

Learn more in Use sections.

Step 2: Add a date of birth field

  1. Drag a Sections block onto the canvas.

  2. Add the Date and time block to Section 1.

  3. Type your question in the block, for example, What is your date of birth?

  4. This field allows you to calculate the contact’s age dynamically, which is essential for setting up the logic in the next step.

    You can configure other details of this section later.

Step 3: Configure action button logic

  1. Drag a Button block onto the canvas and enter a label, such as Submit or Next.

  2. Select the Settings button, enter a section title, and set Action button logic to YES.

  3. Select HIDE ACTION BUTTONS WHEN.
    By default, the action buttons are set to show.

  4. In the Edit rule panel, set the following:

    • Action name - enter a name, such as, for example, Hide when born within last 18 years.

    • When - choose All rules are met.

  5. Select click to add a rule and set the following:

    • Field - this is the field that you are creating a condition for. Select CHANGE to configure a different field.

    • Clause - select Is within the last.

    • Condition - enter a number, for example, 21.

    • Condition - choose years from the dropdown to ensure the rule checks for age in full years.

      This rule hides the Submit or Next button if the contact is under the required age, effectively preventing them from proceeding or submitting the form.

    • Select APPLY twice.


Step 4: Add a rejection section

  1. Add a new section with a Text block.

  2. Include a message, for example, Sorry, you must be 21 or older to sign up. We’re committed to responsible marketing.

  3. In the Section logic settings, configure this section to be shown only if the contact’s date of birth is within the restricted age range.

  4. Ensure this section is hidden by default.

Step 5: Add the rest of your content

Add any additional sections, fields, or content that should only be visible to eligible contacts.

Step 6: Publish and test

  1. Select PUBLISH to make your Page or Form live.

  2. Test with birthdates that are exactly on the age threshold, for example, exactly 21 years ago today to ensure your logic is accurate.


See also

Did this answer your question?