Collect SMS subscribers using a web modal

  • Updated
If you had access to campaigns prior to April 2023, Optimizely updated the tab name from Campaigns to Activation. All functionality remains the same.

Before you start engaging with your customers through SMS and MMS, they need to give you permission to contact them on their phones. Set up a web modal that allows your shoppers to enter their phone numbers and explicitly opt-in for SMS communications.

Configure a web modal for SMS opt-in

You can either add a phone number field to an existing form in a web modal or create a modal and form for phone number collection.

The example below shows how to set up an Optimizely Data Platform (ODP) web modal for phone number collection by creating a modal and form.

Step 1: Create a web modal

  1. Go to Activation > Engage > Create New Campaign > Web.
  2. Click Create From Scratch.
  3. The Enrollment section is set to All Visitors by default. If you want to use a real-time segment as your audience for this campaign, select one from the list.
  4. Click to edit Touchpoint 1.
  5. Click Web Modal.
  6. Expand Targets and enter the website where you want visitors to see your web modal.Screen_Shot_2020-04-02_at_1.27.19_PM.png

Step 2: Configure opt-in form

Design the layout of your web modal. You need the following form elements for data collection to work:

  • Text field for email collection
  • Text field for phone number collection
  • Two checkboxes; one that lets customers explicitly opt in to email communications, and another that lets customers explicitly opt in to SMS communications
  • Submit button

To add the required elements, go to the Elements tab of the designer and expand the Forms section.

Step 3: Configure opt-in fields

Email address field

  1. Select the first text field in your form.
  2. Go to the Details tab.
  3. Expand the Field drop-down list and select Email. This automatically makes the field required.

Phone number field with country code selector

  1. Select the second text field.
  2. Go to the Details tab.
  3. Expand the Field drop-down list and select Phone.
    ODP automatically enables Show Country Code and Enable Country Code Selection and selects the United States as the Default Country Code. You should leave the country code selector enabled to help your visitors with proper phone number formatting.
  4. Ensure Required is enabled.


  1. Select the checkbox field.
  2. Go to the Details tab.
  3. Expand the Action drop-down list and select Opt-In
  4. Enable Required to ensure you obtain explicit consent from your visitors for email and SMS marketing communications.
    If you do not set the checkbox Identifier field to All (Global Opt-In), you must have one checkbox per messaging identifier field. In this example, you need one checkbox where Identifier is set to Email, and another checkbox where Identifier is set to Phone.

Submit button

  1. Select the submit button field.
  2. Go to the Details tab. 
  3. Expand the Action drop-down list and select Confirmation Design. This ensures you are not interrupting your visitor’s place on your site when they click to submit the form.

Step 4: Set when the modal displays

  1. Expand the Triggers section.
  2. Adjust the settings as desired.

Step 5: Preview the web modal

  1. Click Preview.
  2. Enter the Webpage URL where you want to preview the web modal.
  3. Click Generate Preview.

A new browser tab opens with a preview of your web modal.

Step 6: Create a confirmation message

As a best practice, you should also create an SMS campaign that will send a confirmation message to your new SMS subscribers. You should launch this campaign before you make your web modal live.