SMS opt-in and collection

Collect phone numbers for SMS marketing

Building an engaged audience is crucial for any SMS marketing strategy and it starts with acquiring your user's phone number.

OneSignal offers user-friendly and effective forms for your users to opt in or double opt-in to SMS messaging. Each method caters to different user preferences and regulatory requirements:

  1. Log-in collection opt-in form
  2. Coupon code promotional opt-in form
  3. Promotional double opt-in form
  4. Promotional text-to-subscribe
  5. Promotional text-to-subscribe via advertisement

Deciding between opt in and double opt-in?

Which form to use depends on your goals and objectives, your target audience, the nature of your business, and local regulations.

Opt in is faster and easier to implement and can lead to a higher volume of phone numbers. Users can also immediately start to receive text messages.

Double opt-in requires users to also confirm their subscription via SMS, which may lead to drop-off. However, double opt-in can help improve the quality of your contact list by reducing invalid numbers. It can also increase engagement rates and lower spam complaints by weeding out low-intent audiences, so you're reaching the people who really want to hear from you.

Example opt-in flows

👩‍💻

See a reference example

For all of these examples, you can check out a working demo available on Github, take a look for inspiration.

To create a new SMS subscription record, call the Create user endpoint.

Expected response from this endpoint:

  • 200 - success, a subscription record has been created
  • 202 - subscription record was already created

Log-in collection opt-in form

In your sign-up flows, you can collect phone numbers. Make sure to include consent boxes, that are 'un-ticked' by default.

Log-in Collection Opt-in

Log-in Collection Opt-in

Coupon code promotional opt-in form

A coupon code promotional opt-in is a standard way to incentivize a customer to provide you with their phone number. It's a great choice for Desktop and Mobile experiences. Because the recipients opts in only by providing their phone number, this would not be considered best practice is some locations that require a double opt-in flow.

Coupon Code Promotional Opt-in

Coupon Code Promotional Opt-in

📘

Consider a double-opt in approach

This method for SMS collection only accounts for one form of opt-in consent. To improve account verification and follow best practices, you might want to consider implementing a Double Opt-in collection methodology like one of the options below.

Promotional double opt-in form

This option is a standard Double Opt-in flow. It works great for both Desktop and Mobile experiences. It does require turning on the Double Opt-in Prompt in Settings and setting up a keyword reply.

Promotional Double Opt-in

Promotional Double Opt-in

This flow includes 4 steps:

  1. Phone number collection
  2. OneSignal will text the Send Message Prompt template
  3. OneSignal receives the keyword reply
  4. OneSignal sends keyword reply template, and marks the recipient as 'subscribed'

Requirements: For this method to work you will need to:

  1. Ensure all message replies are properly syncing to OneSignal.
  2. Turn on Send Message Prompt and select a template
  3. Set up a Keyword reply with a response template.

Promotional Text-to-Subscribe

This option has been shown to provide a higher rate, but it should only be implemented to display on obile devices, not desktop devices.

Promotional Text-to-Subscribe

Promotional Text-to-Subscribe

Text-to-subscribe works as a double opt-in flow because there are two opportunities for the person to consent to subscribe to marketing messages: 1. When they click the first button, and 2. When they send the pre-populated text to the provided number.

The experience provides a clickable link that opens the recipient's SMS app with a pre-populated message.

You can build a clickable link using URI Encoding to generate the link. In general, you'll end up building a clickable link similar to the one below:

<div class="modal" id="smsLinkModal">
  <p>Click below to subscribe via SMS:</p>
   <a href="sms:+123456789?&body=Send%20this%20message%20to%20subscribe%20to%20marketing%20messages%20and%20receive%2015%25%20off!%20%5BRef%3A15off%5D">
      Click here to text us!
  </a>
</div>

In this example URL:

  • The sms:+123456789 parameter specifies that it's an SMS link and includes the phone number.
  • The ?&body= parameter is used to include a pre-filled message.
  • The text Send this message to subscribe to marketing messages and receive 15% off! [Ref:15off] is URL-encoded to ensure special characters are correctly interpreted by web browsers and mobile devices. For example:
    • %20 is used for spaces
    • %25 is used for the percent symbol (%)
    • %5B and %5D are used for square brackets [ and ]
    • %3A is used for the colon :

Promotional text-to-subscribe via advertisement

This option is great for TV ads, posters, or other forms of media. Tell your customer to text a text-to-subscribe keyword to one of your Sender Identities.

Promotional Text to Subscribe via Advertisement

Promotional Text to Subscribe via Advertisement

Making sure your opt-in flows are compliant

Sending SMS messages is subject to regulatory oversight. In your opt-in flows, we recommend following these compliance steps:

  1. Always include your business name: As shown in the examples, your business name should be included in every SMS message, especially in the first interaction.
  2. Opt-in language: Make it clear that users are opting in to receive messages from your business.
  3. Opt-out instructions: Provide easy opt-out options with every message (e.g., "Reply STOP to unsubscribe").
  4. Message and data rates: Always include a disclaimer that standard message and data rates may apply.
  5. Consent not a condition of purchase: Include this disclaimer to comply with regulations and ensure transparency.
  6. Link to terms and privacy policy: When appropriate, include a link to your Terms of Service or Privacy Policy, especially in the initial subscription messages.
  7. Identify the message purpose: When appropriate, explain the types of messages you expect to send.

By following these guidelines, you’ll ensure that your SMS campaigns are compliant with industry standards and regulations, while also maintaining clarity and trust with your customers. Learn more at SMS Regulatory Compliance.

Managing your double opt-in prompts

If you would like to send a SMS to each new SMS subscription added. You can turn on the Send Message Prompt setting by navigating to SMS Settings > Consent Management. This will automatically send the template selected to all new SMS subscriptions created through the API or SDKs. Subscriptions added via the CSV Importer will not receive a message prompt.

The send message prompt will send from your default Sender Identity. It's recommended to use a Messaging Service that you have set up for transactional sending to ensure that these messages are sent in a timely manner.

Text-to-subscribe keywords

Add a keyword reply to complete the double opt flow. For example, you might use a generic text-to-subscribe keyword, a special code, or a keyword like Y or Subscribe.

Keywords can be any alpha-numeric value. All incoming messages will be checked for keywords, if the message has many words, we check the first word, last word, and any words between parentheses, e.g. (summer sale).

Requirement: Ensure that you have set up your SMS replies to automatically sync to OneSignal.

Bypassing the prompt

If you want to use Double Opt-in in some scenarios but not 100% of the time. You can bypass the Send Message Prompt by setting the API parameter send_double_opt_in_prompt to false.


What’s Next

Learn more about Sending SMS