Skip to main content

Convert one-time buyers into repeat customers by delivering personalized communications.

 

Target KPI: Increase Repeat Purchases

Desired Outcome: Customer retention strategies have gained equal importance, if not greater, to acquisition strategies. Activating this use case can increase repeat purchases and optimize ad spend based on lifetime customer value by designing personalized messaging using a customer’s preferred categories.

---

Step 1: Add the required Sources


In your workspace, add a new prod or dev source for your website and (optional) another for your order processing system. This should be your website where checkout events will be tracked and the system that captures completed orders. These sources will be responsible for collecting the required Track Events and sending them to Segment.

 

Sign Up or Log In to Segment

First, access the Segment platform by signing up or logging into your existing account.


Create a Source for Your Website

A source in Segment acts as the origin of data you collect, such as user interactions on your website.

  1. In your Segment workspace, navigate to the Sources section.
  2. Click the Add Source button.
  3. From the catalog of sources, select JavaScript (for websites)
  4. Provide a name for your source, e.g., "i.e. Company Website - Dev or Prod".
  5. Optionally, add labels for organization
  6. Enter your website URL
  7. Click Create Source button

AD_4nXdDSesbAfEY-IB84kjEoLYbs1sK-fhigT1c40HERURc6Z9_nyTOam04M7ZIDF-cCDmvzobzMHketriBRjdzz3FGLQ9n4RXPfkx9gdTeVQBx9ejeC4TJ6rg0NI38ElYWz47_h0VY8CZMaH2UsNlgZbOv4GBf?key=9Lm1eYfOfJWERt8eSzFQ0A


Install the Segment Snippet

After creating your source, Segment will provide you with a JavaScript snippet.

  1. Copy the JavaScript snippet provided by Segment.
  2. Paste the snippet into the <head> tag of your site to install Segment.

If you need to add a source for your server, mobile app, or any other touchpoint please refer to the documentation for easy setup

 

Step 2: Track your events


In order to build the funnels needed to personalize campaigns, you'll need to track two key events: 'Page Viewed' from your website and 'Order Completed' from your server source. 

  • Page Viewed: This event will start sending to Segment once Analytics.js is added to the site
  • Order Completed: Manually add this event to your site (See V2 Ecommerce spec).

 

AD_4nXd9Fl916vnXAL-j9ebMepVn8on9FggWsLm0nUhh75N1sJcYEY8tqZMYtZYLovVRdShXTPSw4NhU75GVxK1SiepbZOQVzlIXGu9-RW6Q3UyRZMeqiPZU3-bRLcoU_8GLDhkKzXv16xNCTa06ihufnzxSMcfH?key=Yjekc3LPDs_sjde0-D-Qog

 

In this example, we're not only tracking the event 'Page Viewed' but also sending additional properties like 'page_category' and 'page_name'. These properties provide important context about the event and can be extremely valuable in your analysis. Learn more about properties.

 

It should be noted that 'Order Completed' should trigger an Identify call because this event allows you to tie a user to their actions and record traits about them i.e., first_name, last_name, email. This can further be used for personalized messaging in your re-engagement campaign. 
 

Only Identify calls can add and update user traits to a profile. For connections-only customers, the Identify event can still be mapped to downstream destinations to create/update user profiles.

 

Step 3: Add Destinations

Choose where you want to send the collected data—for this use case it could be an email or marketing automation platform.

  1. In your Segment workspace, add a new destination
  2. Select your preferred tool from the catalog. This destination will receive the data collected by your source and use it according to your needs


Step 4: Test your setup

Ensure your data collection is configured correctly:

  1. Perform the actions you’re tracking on your development website.
  2. Check if the events are correctly recorded in your Segment debugger and analytics tool.

AD_4nXepuS-p2D5EXhQ5c-eLtBUIDflXsOlf-w7TyP0OWUm073hpsvWQClM9wxk03LEdoDo2gcAgjnsNJLZxcxagR4GyGMur5Y4awePwrn76SEipEAGZfc6CXtWmHKHwT7Qf_uhmznM2jJebHv_ZsTC1n-e7WRs?key=xuTaHkcDdgHE2UDOqf05Bg

 

The Source Debugger is a tool that helps you confirm that API calls made from your website, mobile app, or servers arrive to your Segment Source, so you can troubleshoot your Segment setup even quicker. 

Your data may not show up instantaneously and there may be a delay, but once the data is flowing you are ready to move to the next step.

 

Step 5: Analyze and activate


With accurate setup and data flow:

  1. Analyze the data to understand user behavior throughout the ordering process
  2. Identify users who have already made a purchase from your business and may be ready to buy again
  3. Create personalized marketing campaigns to encourage these users to complete another purchase or look at more related items that might interest them

Below is an example of a re-engagement campaign designed to drive repeat purchases. Leveraging the events and properties you're tracking, you can use a similar approach to deliver personalized experiences for returning users in their next session.

AD_4nXd1S5BOP6U-UZCNLHkMWODEVb8JXdZ3I8omdbKzN47khfUzKFULLwlRczu3BvOfHBCbkeN2ttNoexmevbxMRcwEwfdx1OTGz7cy3Osmj-euw-zZzeR8EndGKEjJ4pAhcdplRzxSFzoqf9sokEOZFmVLA0h7?key=Yjekc3LPDs_sjde0-D-Qog

Example of cart re-engagement campaign

 

Final thoughts


Personalized re-engagement campaigns can boost repeat purchases, transforming one-time buyers into loyal customers. By leveraging Twilio Segment's capabilities to track, analyze, and act on user data, businesses can deliver tailored communications that enhance customer retention and optimize ad spend based on lifetime value.
 

Want to discuss this topic with the community? Start a thread in our Discussion Forum.