Real-time segments are created using streaming behaviors and historical data (by referencing attributes). Real-time segmentation enables deeper customers insights and activations in real-time. This type of segment provides opportunities for companies to be more responsive to their customers no matter where they are in the customer journey, specifically real-time web personalization using the TD JS SDK and Profiles API.
Real-time Segmentation provides the ability to personalize the content, ads, and pages, while your customers are visiting your website. For example, an e-Commerce company would like to show "Today's Special Camera Offer" banner ads in the page, if visitors have navigated to the Camera category multiple times while they're exploring the products.
- Real-time segmentation is based on Segmentation Primitives that can be limited for realtime and compared to Batch-based records.
Realtime Segments operates against streaming data as the data arrives into Treasure Data in real-time to help you provide for the following use-cases:
If visitors do some meaningful actions in the website, you can specifically target these users "instantly" through other means
Show personalized content, banner, and ads in the website for higher engagements and conversions
Show a chat modal dialog to help customers complete any open transactions that they may have started
Show help messages if customers are going back and forth with same pages
Scoring users in real time, and show special offers to valuable visitors and customers
You will need to set up website tracking by installing the TD JS SDK before setting up a real-time segment.
Using the TD Console, obtain your write only API Key. For example:
Locate and open the HTML files of the web pages that you want to have tracked for your real-time segmentation.
Add the following code to the header (<head>) of each of the pages that you want to track.
Add the following code snippet to include your write only API key and indicate the Treasure Data database where you want to have information from the sites saved to. Also enable cross-domain tracking and enable tracking of page views.
Optionally, set custom parameters.
Optionally, track custom events. For example, to track a button click add the following:
Optionally, track events by an individual. Be sure to comply with all necessary data collection and privacy policies if you choose to do this.
Setting Up a Parent Segment to Use for Real-time Segmentation
The behavior table must be set up in the master segment for you to set up a real-time segment.
- Open TD Console
Select Data Workbench > Master Segments (Parent Segment).
Select New Master Segment to create a new master segment or select an existing master segment.
Optionally, an Attribute table by clicking on the +.
Add the Behavior table. This is required for real-time segmentation.
The behavior table must be the table that the event collector put the data into above. And it should include the following columns:
Define All columns for the Behavior table.
- Select Save.