cs-icon.svg

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

Additional Resource:

Let's follow this step-by-step guide to set up a Contentstack Destination within Segment to connect with Contentstack Personalize.

Steps for Executions

  1. Integrate Segment into your Website
  2. Configure the Contentstack Destination
  3. Create a Personalize Experience
  1. 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:

    1. 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.Source-ID
    2. 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.
    3. Send Events to Segment: Use Segment’s track or identify calls to send event data. These events will also sync with Contentstack Personalize.Event-Trigger
    4. 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.
  2. Configure the Contentstack Destination

    To configure the Contentstack Destination within Twilio Segment, follow the steps given below:

    1. Create a Segment Source: Ensure that a valid source of events is streaming into your Segment workspace, as discussed in the Integration steps above.
    2. 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.Catalog-Contentstack-Destinations
    3. Configure Mappings: In the Mappings section of your Segment setup, follow the steps:
      1. 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.
      2. Configure Mapping Settings: Ensure the payload is structured correctly and mapped as per your requirements.
      3. Save the Mappings: Click the Save button to save the mappings.
      Catalog-Contentstack-Web-Destination-Mappings
    4. 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.Catalog-Contentstack-Web-Destination-Settings
    5. Test the Destination: Use the Event Tester tool to verify the destination configuration:
      1. Send a payload to the Contentstack destination based on your Segment call type.
      2. Review the results to ensure the data is flowing properly into Contentstack Personalize.
  3. 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:

    1. Segmented Experience
    2. A/B Test Experience

    Steps to Create a Personalize Segmented Experience

    1. 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.Personalize-Project
    2. 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.Personalize-Attributes

      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.

      Segment-DataID
    3. 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.Personalize-Audiences
    4. Create Segmented Experiences: Create a Segmented experience within your Personalize project for each audience.Personalize-Experience-Segmented

      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.

    5. Activate the Experience: Once configured, activate the Segmented Experience for use within the project.Personalize-Experience-Segmented-Dashboard

    Steps to Create a Personalize A/B Test Experience

    1. 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.Personalize-Project
    2. Create Events: In the Events section of your personalize project, create new events with unique keys. For more details, refer to the Events documentation.Personalize-Events

      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.

      Segment-EventID
    3. Create A/B Test Experiences: Create an A/B Test experience within your Personalize project for each audience.Personalize-Experience-ABTest

      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.

    4. Activate the Experience: Once configured, activate the A/B Test Experience for use within the project.Personalize-Experience-ABTest-Dashboard

    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.

Was this article helpful?
^