Skip to main content

Integrating Segment

You can quickly and easily integrate Studio with Segment. Once configured, you can use Studio's built-in Segment component to leverage Segments powerful customer data platform in your storefront.

Segment is a customer data platform that simplifies the process of collecting data and connecting to new tools. With Segment, you can collect, transform, send, and archive your Studio data, and send the data to your marketing, product, and analytics tools, including data warehouses.

You can sync your Commerce data with the Commerce Segment integration. This allows all customer and order changes to be synced with Studio, ensuring that when customers view product details pages or when products are added to carts in your Studio storefront, Segment first processes the data, then translates and routes it to the destinations you have enabled in Segment. This information enables you to personalize the shopper experience that you are offering to your shoppers.

Building Customer Profiles Using Segment Unify

You can use Segment Unify to build a complete view of your customers. With identity resolution, you can track every interaction across an entire user journey in Studio, to create unified, real-time customer identities. You can then use these profiles to provide personalized experiences for your shoppers, using computer traits and predictive analytics. For example, you can provide a special offer to VIP customers. See Using the Segment Integration.

Prerequisites

You must have the following before configuring the Segment integration.

  1. Ensure that you are integrated with Commerce. See Getting Started with Composable Commerce.
  2. A Studio storefront.
  3. A Segment account with your Elastic Path Studio Source configured. See Elastic Path Studio Source.

Best Practices

Follow these steps to integrate with Segment.

  1. In Commerce Manager, go to Composer and configure a Segment integration in Integrations Hub.
  2. In Studio, configure the Segment integration.

Configure the Segment Integration

Follow these steps to configure the Segment integration in Studio.

  1. Select Settings > Integrations.

  2. Navigate to Tracking and Analytics.

  3. Select the plus icon next to Segment.

  4. Configure the Segment settings.

    OptionRequiredDescription
    Source IDRequiredA Segment source ID that allows you to push data to your Segment account.
    Source Write KeyRequiredA unique identifier for your Commerce source. See Find your write key.
    Unify Space IDOptionalA Unify ID that allows you to pull insights out of Segment. See Using Segment Unify.
    Unify Access TokenOptionalAn access token that allows you to pull insights out of Segment. See Using Segment Unify.
  5. Select Connect account.

Using the Segment Integration

You can use your Segment integration to build customer profiles based on their interactions in your Studio storefront.

Using Segment Computed Traits

The following example describes using a Segment computer trait to provide a special offer to a new customer.

  1. Select Content > Landing Pages.

  2. Select the landing page where you want to configure your computer trait. For example, you might want to configure this on your product detail page, product detail page templates or any of your site pages.

  3. To enable conditional content on your section, select the {...} icon from the section toolbar.

  4. Select Condition and select Trait from the drop-down list.

    segment trait

  5. You must have created a computed trait in Unify. Then, in Studio, input a value that corresponds to a computed trait in Unify. The value you input in Studio must reference the trait key and not the trait name. For example, for the LTV computed trait in Segment:

    segment computed trait

    Configure the parameter in Studio as follows:

    ParameterValue
    Parameterltv
    Operatorgreater than or equal
    Value25
  6. Add a text box.

  7. Add your text, depending on your requirements.

    segment trait text

  8. Save and publish your changes.

  9. When a shopper logs into the storefront and starts viewing products, you can see in your source in Segment, a new event stream that has all the activity for this user.

    segment identity event

    Once the shopper meets the condition, the storefront automatically offers them the promotion.

    25% off offer

Using Segment Audience Personalization

The following example describes personalizing content for an Audience in Segment. For example, you may want to offer a promotion to VIP Customers.

  1. Select Content > Landing Pages.

  2. Select the landing page where you want to configure your audience. For example, you might want to configure this on your product detail page, product detail page templates, or any of your site pages.

  3. To enable conditional content on your section, select the {...} icon from the section toolbar.

  4. Select Condition and select Audience from the drop-down list.

    segment computed trait

    You must have defined an audience in Unify, for example, VIP Customers. Then, in Studio, input a value that corresponds to your audience in Unify. The value you input in Studio must reference the audience key. For example, for the VIP Customers audience in Segment, configure the parameter in Studio as follows:

    ParameterValue
    Operatorequals
    Valuevip-customers
    note

    To personalize content for more than one audience, you can use advanced comparison. For example, if you have several audiences beginning with vip, you can target them all using the starts with operator.

    Once the shopper meets the condition, the storefront automatically offers them the promotion.

Viewing Studio Event Streams in Segment

Event streams sources collect data from Studio to monitor shoppers actions in your Studio storefronts.

  1. If you go to Unify > Profile Explorer, you can see the profile for the shopper.

    unify customer profile

  2. In addition, if you select a user, you can view the user_id for the shopper. This is also the Composable Commerce account number.

    unify_identity

For more information about Segment's computer traits, audience, and predictive analytics, see Segment Documentation.