Recipes
RetailMedia

Powering Your Customer Engagement Strategy Using Online & Offline Data

In this recipe, we’ll show you how to take your offline and online data from Segment and Twilio, and join it all together to get a 360-degree picture of the entire customer journey.

Segment

Made by Segment

What do you need?

  • Segment

  • Twilio

Powering Your Customer Engagement Strategy Using Online & Offline Data

With a huge integration catalog and plenty of no-code features, Segment provides easy-to-maintain capability to your teams with minimal engineering effort. Great data doesn't have to be hard work!

Get started for free

Customer relationships used to be simple. Most interactions took place in a single channel, usually 1:1 with a salesperson, and the resulting data was easily managed in a CRM.

Today, a customer’s path to purchase is more complex than ever, often involving a variety of online and offline channels. Your next customer might click on an email, browse through your website, and then purchase in-store.

6Segment Twilio tutorial

Customer relationships - then and now

Getting a complete picture of the role online and offline channels play in your customer engagement strategy has traditionally been difficult to achieve, due to the lack of robust infrastructure to connect those different data sources together.

Thankfully, a customer data platform solves this problem by being your one-stop-shop for customer data. The ability to centralize different data sources in one place gives you customer engagement superpowers – you can see all the activity of a user, from any channel, online or offline, in a single record. 

In this guide, we’ll show you how to take your offline and online data from Segment and Twilio, and join it all together to get a 360-degree picture of the entire customer journey.

In this tutorial, we’ll use the example of a customer who engages with a fictional online real estate marketplace company – realestate.com – over the phone (via Twilio) and online.

Step 1: Connect your data warehouse to Segment

The first step is to connect your data warehouse, that central repository where the majority of your business data lives, to Segment. 

This is so Segment can start the heavy lifting of categorizing, schematizing, and connecting the different types of data in your warehouse, so you can get to your insights faster.

Segment partners with all your favorites in the cloud data warehouse space - Snowflake, Redshift, Postgres, and more. 

Sign up or login to your Segment account, head to the Segment catalog and connect Segment to the data warehouse used by your business. Check out these step by step instructions on how to do that.

5Segment Twilio tutorial

The warehouses available via the Segment catalog

9Segment Twilio tutorial

Connect your Segment workspace to Snowflake

Step 2: Connect your website to Segment

The next step is to implement Segment on your website so you can track visitor’s website activity.

As a refresher Segment enables you to collect multiple behavioral and demographic data points from across your online properties - whether that’s websites, apps, ads and landing pages.

In this case, we want to track where the visitor came to realestate.com (e.g a Facebook ad), and what activity they performed (e.g completing a search, browsing specific listings, scheduling tours.

  1. Create a Source to collect data on the realestate.com website. A Source is where actions taken by customers such as Listing Viewed and Tour Scheduled are collected as “events” and sent to Segment.

  2. Install the Segment snippet on your website. Copy and paste the snippet from the overview page into the <head> tag of your site. 

  3. Implement events. Select the events you want to trigger when a visitor takes an action. You can define additional metadata to describe those events and send them as properties to Segment e.g. ‘property type: townhome’. Pro tip: use context properties to capture UTM parameters that resulted in the API call.

  4. Activity like Property Inquiry Sent or Agent Contacted (really any conversion event you’d like to track) can be tracked via Segment. This is so we can associate these online clickstream events to offline data that contributed to the conversion.

11Segment Twilio tutorial
8Segment Twilio tutorial
4Segment Twilio tutorial

Step 3: Set up a Twilio Source

Now let’s say after browsing through the website, the visitor picks up the phone and calls the agent (the Twilio number associated with the seller) on the page listing. 

1Segment Twilio tutorial

How can we ensure that the activity that took place online is joined together with the activity offline?

With Twilio’s call tracking feature, you can attribute calls with precision, and connect Twilio call logs with your website data via Segment.

  1. From the Sources page in your Segment workspace, click Add Source.

  2. Choose Twilio from the options provided. 

    10Segment Twilio tutorial
  3. Give the source a nickname and a schema name. The nickname is a label used in the Segment interface, and the schema name is the namespace you query against in your warehouse. Both can be whatever you like, but we recommend sticking to something that reflects the source itself, like Twilio for nickname and twilio

    or twilio_prod for the schema name. Note: You can add multiple instances if you have multiple Twilio accounts. That’s why we allow you to customize the source’s nickname and schema name!

  4. Click Connect, and you’ll be prompted for your Twilio Account SID. You can find it on your Twilio account under the project settings.

  5. You’ll be re-directed to Twilio’s app and you’ll need to authorize Segment to read from your account data. To authorize, click the Allow button. Once approved, you’ll be redirected back to the setup page in the Segment app.

Step 4: Joining online conversion and offline call data in your data warehouse

Now it’s time to unify these different data sources in your data warehouse, so your team doesn’t have to go to five different places to understand customer behavior.

  1. Once you’ve authorized your Twilio source, you will be directed to connect your Twilio source to your data warehouse. Complete this step by selecting the warehouse you configured in step 1.

  2. Click the Finish button. We’ll begin syncing your Twilio data into Segment momentarily, and it will be written to your warehouse at your next warehouse run.

  3. You can sync all your data from Twilio, or if you want to keep your tables neat and tidy, leverage Segment’s selective sync feature. This ensures only the data you want finds its way into your database. For example, you could just send the call data collected from your Twilio source into your warehouse, and unselect messages/ addresses from the collections.

    3Segment Twilio tutorial

  4. From your Segment workspace, connect and sync the website sources to your data warehouse (shown as realestate.com_web in the diagram below).

  5. That’s it! Your Twilio and Segment data are all connected in one place.

    2Segment Twilio tutorial

    Website data (tracked via Segment) in Snowflake

7Segment Twilio tutorial

Call data (tracked via Twilio) in Snowflake

Now you can start gaining some interesting insights into both datasets.

For example, realestate.com can now provide sellers with online data such as number of views and number of times an inquiry was requested, and glean insights to qualify higher intent leads e.g. a lead that calls in can be 10 times more valuable than one that submits a form or casually interacts with listings on its website.

Thus realestate.com can provide sellers with data to identify the buying behavior of buyers, so sellers can target listings that resonate with these buyers. 

Protip: Since you already have your Segment data piped into your data warehouse, you only have to connect a BI tool like Looker to this Segment Database.

Using Looker and Looker Blocks you can quickly build a centralized data model in Looker with visualization and exploration capabilities, giving everyone across the organization – from marketing to sales – access to the data.

Wrapping up

As a recap, here’s what we’ve done in this recipe:

  • Connected our data warehouse to Segment

  • Implemented event tracking to track conversion events on our website

  • Connected Twilio to Segment to attribute offline call events to online website conversions

  • Synced both datasets back to our data warehouse for analysis

Want to start combining offline and online data for your own business? Get in touch with a member of the team or start building today.

Getting started is easy

Start connecting your data with Segment.