SMS Marketing Automation with Twilio and Customer.io

Sarah Chua
5 min readMay 15, 2022

Recently, I have an interest to explore SMS marketing automation. There are definitely quite a number of marketing automation platforms out there. Some platforms are more friendly than others in terms of being accessible to run trials and explorations on. And Twilio and customer.io are definitely are definitely more accessible. :)

The Marketing Campaign

Figure 1: Campaign message flow

Figure 1 shows the flow of messages I explored.

[1] Sending a message to the customer to excite the customer on an exclusive offer. This could alternatively be a call to action on a website.

[2] The customer sends a message to indicate interest to get a discount code

[3] Customer getting his exclusive discount code

Twilio + Customer.io Setup

Figure 2: Solution components

Figure 2 shows the main modules and components in Twilio and customer.io.

To start off, sign up for trial accounts on customer.io and Twilio individually. To integrate the 2, just key in the Twilio account SID and auth token inside customer.io

Figure 3 Sequence Diagram

And figure 3 shows the flow and sequence of API calls and events.

Customer.io Setups

People and Segmentation

Figure 4 People

For a quick start, I just uploaded a list of users I want to try the campaigning on from google sheets. There are a couple of things to note like the date time and timezone which have to adhere to the expected format.

But other than that the upload is pretty straightforward where the column names are automatically detected. Of course, for a production environment, the people should updated via an API call to customer.io

Figure 5 Segments

Under segments, there are some pre-defined segments. The segments basically allow definition of attributes to categorize people so that we can identify people who meet certain criteria that we want to target campaigns on or people who have reached a certain stage to execute a certain action in a campaign flow.

I created 2 more segments to identify people who are interested to get a discount coupon and people who have received the discount coupon.

Campaign

Figure 6 Campaign workflow designer

Campaign workflow is a pretty easy to use drag and drop UI to design the workflow.

Figure 7 SMS content editing

The content to be sent can be crafted and customized using liquid tags for e.g. in Figure 7 here to include the customer’s first name in the message.

Twilio Setups

Sender IDs and phone numbers

For sending SMS, depending on the country, a phone number or alphanumeric sender ID can used.

Functions

Figure 8 Twilio Functions triggering customer.io event

When a customer replies to indicate interest in getting a discount code, I want to feed this event back to customer.io so that the overall user journey can be tracked and discount code message can be sent.

Twilio will receive the reply from the user and I can use Twilio Functions to implement the calling of the customer.io API to register the event.

Figure 8 shows 1 possible implementation. The function is triggered when a message comes in. The function can be triggered by calling the URL, copy the URL here and see the configuration in the next section in the messaging service.

Messaging Service

A messaging service can be set up to more efficiently manage bulk global messaging. Once it is setup, customer.io can detect that and we can choose to use the messaging service for SMS delivery.

Figure 9 Add phone numbers and dynamic alphanumeric senders to service
Figure 10 Configure incoming message handling

As mentioned in the section above, we can set up handling when a customer replies back. This can be set up in the integration section of the messaging service.

Paste the URL of the function for triggering the customer.io API here in the Request URL under “Send a webhook”

Seeing things in action 🎬

After all the setups it is time to see things in action!

We can see statistics under the campaign including the sent and converted rates on a consolidated and individual’s journey level. Some statistics like opened and clicked are only available for email.

Figure 11 Campaign Statistics
Figure 12 Campaign Metrics
Figure 13 Individual’s user journey

P.S.: I was pretty puzzled why the campaign turned all outgoing messages into draft instead of starting to send them out immediately. Then I realized there is this “Queue Draft” setting for the SMS. Had to switch it to “Send Automatically” to get the messages to be sent out automatically when the time comes.

Improvements!

There is more that I want to look at exploring:

  • Other communication channels: SMS may or may not be a popular channel to communicate. For one, I prefer using WhatsApp. Marketing messaging via WhatsApp, Email and Push are already readily available in the platforms. So probably I can explore the technicalities of those next.
  • Automating the customer data updates: It definitely is not efficient to be constantly uploading customer data via excel / google sheets. We can explore CDP platforms like Segment to implement the automated of customer events/data changes from our internal data tools or engagement end points like our web sites and mobile apps.
  • Other kinds of campaigns: A/B testing for different messaging content and campaigns which can be configured in the same platforms
  • Tracking conversion: Did the customer really use the coupon and buy something?
  • Business Intelligence: Some fair amount of data and dashboards are available in customer.io and Twilio but we can also explore tools like Mix Panel, Tableau or Google Analytics to derive more advanced views across other customer engagements and do more complex data slicing and dicing.

Have you guys explored other similar platforms? Hope to have a chance to do further explorations and get to know more options!

--

--