Twilio Segment Destination Integration with Personalize
Contentstack Personalize and Twilio Segment Integration enables dynamic and data-driven personalization. This allows real-time personalization by using customer data to tailor content, improve engagement, and optimize the user journey across various channels, ensuring a seamless and targeted experience for each user.
Twilio Segment captures and unifies user data across various platforms, while Contentstack Personalize uses this data to deliver customized content in real time. This integration allows the syncing of custom attributes, computed attributes, events, and audiences to the Personalize project.
Contentstack Segment Destinations
In Twilio Segment, a Destination refers to a service where data collected from a Source (e.g., websites, apps) is sent for processing, analysis, or engagement purposes, in our case, Contentstack Personalize.
Contentstack provides two types of destinations in the Segment Destination Catalog. Depending on your use case, you can use either or both:
- Contentstack Web: Supports syncing of events and attributes into Contentstack Personalize.
When to Use Contentstack Web Destination:- Real-Time User Attributes: Use Contentstack Web when you need to capture user attributes in real time based on user actions occurring in the browser. This allows for immediate updates and personalized content delivery.
- Behavior Tracking: Opt for this destination to track user behavior through events performed in the browser. This is essential for applications requiring live interaction and feedback.
- Contentstack Cloud: Supports syncing of audiences and computed traits into Contentstack Personalize.
When to Use Contentstack Cloud Destination:- Syncing Computed Attributes: Choose Contentstack Cloud when you need to sync user’s computed attributes for personalization without manually sending them from the browser. This is beneficial for managing complex user profiles.
- Audience Syncing: Use this destination to sync user audiences for personalization based on their events in the browser. This allows for more strategic audience segmentation and targeted content delivery without real-time interaction.
Additional Resource: To learn more about Contentstack Web and Contentstack Cloud, refer to the Contentstack Web Destination and Contentstack Cloud Destination documentation.
Prerequisites
- Contentstack account that has Personalize enabled
- Access to the Contentstack Organization/Stack as the Owner/Admin
- Access to a project in Personalize
- Twilio Segment Workspace
Additional Resource:
- To configure Personalize for your Organization, refer to the Getting Started with Contentstack Personalize document.
- To configure Segment on your website, refer to the Basic Segment Installation guide.
Let's follow this step-by-step guide to set up a Contentstack Destination within Segment to connect with Contentstack Personalize.
Steps for Executions
- Integrate Segment into your Website
- Configure the Contentstack Destination
- Create a Personalize Experience
Integrate Segment into your Website
To integrate Segment into your website, follow the detailed steps outlined in the Basic Segment Installation guide. Then, follow the given high-level steps for configuration:
- Retrieve Source ID: In Segment, get the Source ID of your source. Go to Sources from the left navigation panel and select the required source. Navigate to the Settings tab of the source, click API Keys, and you will see the Source ID listed there.
- Add Segment to Website: Use analytics.js or any other Segment SDK to add Segment to your website. When initializing the SDK, use the Source ID obtained in the previous step.
- Send Events to Segment: Use Segment’s track or identify calls to send event data. These events will also sync with Contentstack Personalize.
- Receive Personalized Content: Based on your event payloads, personalized content will be delivered to users in real-time using the active variant assigned in Personalize.
Configure the Contentstack Destination
To configure the Contentstack Destination within Twilio Segment, follow the steps given below:
- Create a Segment Source: Ensure that a valid source of events is streaming into your Segment workspace, as discussed in the Integration steps above.
- Install the Contentstack Destination: Navigate to the Segment Destination Catalog, search for Contentstack, and install the desired destination: Contentstack Web or Contentstack Cloud. Refer to the Contentstack Segment Destination section to choose the suitable destination.
- Configure Mappings: In the Mappings section of your Segment setup, follow the steps:
- Add a New Mapping: Click the + New Mapping button to add a new mapping. You can map the values according to the Contentstack Destination installed. Refer to the Contentstack Segment Destination documentation.
- Configure Mapping Settings: Ensure the payload is structured correctly and mapped as per your requirements.
- Save the Mappings: Click the Save button to save the mappings.
- Configure Destination Settings: In the Settings section of your Contentstack destination, provide your Personalize project ID (mandatory) and Personalize Edge API base URL (mandatory), and save the settings.
- Test the Destination: Use the Event Tester tool to verify the destination configuration:
- Send a payload to the Contentstack destination based on your Segment call type.
- Review the results to ensure the data is flowing properly into Contentstack Personalize.
Create a Personalize Experience
In Contentstack Personalize, an Experience allows you to tailor content for different audiences, manage variants, and run A/B tests to enhance user engagement and conversions.
Contentstack Personalize supports 2 types of experiences:
Steps to Create a Personalize Segmented Experience
- Create a Personalize Project: In your Contentstack organization, create a new Personalize project and link your stack to give the project access to entries and the variants needed for personalized content.
- Create Attributes: Navigate to the Attributes sections in the Personalize project to create any custom attributes that need to be mapped from Segment. For more details, refer to the Attributes documentation.
Note: In the beta version, you will need to manually create these data points and ensure that they must match the data IDs within your Segment Workspace.
- Create Audiences: Navigate to the Audiences sections in the Personalize project to create any audiences that need to be mapped from Segment. For more details, refer to the Audiences documentation.
- Create Segmented Experiences: Create a Segmented experience within your Personalize project for each audience.
Define active Variants for each Audience, give them descriptive names, apply Condition, and ensure you note the Short UIDs, as they will be used during content creation.
For further information on creating Segmented experiences, refer to the Create a Segmented Experience document.
- Activate the Experience: Once configured, activate the Segmented Experience for use within the project.
Steps to Create a Personalize A/B Test Experience
- Create a Personalize Project: In your Contentstack organization, create a new Personalize project and link your stack to give the project access to entries and the variants needed for personalized content.
- Create Events: In the Events section of your personalize project, create new events with unique keys. For more details, refer to the Events documentation.
Note: In the beta version, you will need to manually create these event values and ensure that they must match the event values within your Segment Workspace.
- Create A/B Test Experiences: Create an A/B Test experience within your Personalize project for each audience.
Define active Variants for each Audience, give them descriptive names, assign Traffic Distribution percentages for each one, and ensure you note the Short UIDs, as they will be used during content creation. Add all the events in Metrics that are needed for impressions and conversions, and then select the relevant audience(s) for your Target Group.
For further information on creating A/B Test experiences, refer to the Create an A/B Test Experience document.
- Activate the Experience: Once configured, activate the A/B Test Experience for use within the project.
Additional Resource: Learn more about Personalize documentation.
Once the setup is complete, all custom traits and audiences from Segment will be synced into the custom attributes of Contentstack Personalize. These attributes can then be leveraged in the creation of personalized experiences and variants, ensuring precise audience targeting and dynamic content delivery across your digital platforms.