# Segment

## Segment & AB Tasty <a href="#h_01hdhazfbp3pyasy6xnhk42gvn" id="h_01hdhazfbp3pyasy6xnhk42gvn"></a>

**Segment** is a Customer Data Platform (CDP) that helps you collect, clean, and control your customer data.

With Segment, you can easily manage data and integrations with services across your Growth, Product, and Marketing stack. By tracking events and users via Segment’s API and libraries, you can send your product’s data to all of your analytics/marketing platforms, with minimal instrumentation code.

The Segment integration allows you to receive the users’ traits collected in Segment and to use them to create segments within AB Tasty.

Setting up the Segment integration process is a process taking place on both interfaces.

## Integration <a href="#h_01hdhazfbpb718qc7s3aq9pg6w" id="h_01hdhazfbpb718qc7s3aq9pg6w"></a>

### Enabling the integration on AB Tasty <a href="#h_01hdhazfbp4faj2zxfs0z71mhp" id="h_01hdhazfbp4faj2zxfs0z71mhp"></a>

<img src="/files/g1dwkX8BgVC4SU7Y7NV4" alt="" width="563">

To enable the integration on AB Tasty, follow the steps below:

1. Access **Integrations > Integration Hub > Pull**.
2. Search for and select **Segment**.
3. Click **Setup connector.**
4. Give a name to your connector so you can easily retrieve it.
5. Click **Save and create connector.**

Segment is set up. No other action is required here. This will allow AB Tasty to display the traits that will be sent by Segment.

### Enabling the integration on Segment <a href="#h_01hdhazfbp246qdjpq3168hkn0" id="h_01hdhazfbp246qdjpq3168hkn0"></a>

To enable integration on Segment, follow the steps below:

1. From the **Destinations** catalog page in the **Segment** App, click **Add Destination**.
2. Search for “AB Tasty” in the **Destinations** Catalog, and select the **AB Tasty** destination.
3. Choose which **Source** should send data to the **AB Tasty** destination.
4. Enter the “**API Key**” in the “**AB Tasty**” destination settings in Segment.

An integration API key is a unique key that allows a third-party tool to communicate with your specific AB Tasty account i.e., send data to your account.

To generate an API Key, follow the steps below:

1. Access **Settings > Integrations > API Key**.
2. Click **Generate API Key**.

API Key is ready to be used.

Congratulations, integration is now set up and you can target and use Segment traits within AB Tasty’s segment builder.

Segment sends the traits in real-time, i.e. AB Tasty will receive data each time &#x61;**.identify**o&#x72;**.group**call is made.\
Segment pushes its**anonymousId**. The anonymousId is retrieved from the client and used to match users.\
For the traits to be used in AB Tasty’s segment builder (once the integration is set up), we need to match at least one user i.e. empty cohorts will not be displayed in the segment builder.\
Audiences are refreshed at 3 am every night, using data from the previous day\
Example: A user enters a segment at 11 pm on Day 1. They will be activated in AB Tasty at 3am on Day 2.

## Configuration <a href="#h_01hdhazfbpkhsmzqy20fkqytb5" id="h_01hdhazfbpkhsmzqy20fkqytb5"></a>

Once you have activated and configured an integration, you can retrieve Segment traits in the segment builder (available when you create a new segment).&#x20;

<figure><img src="/files/50WlssoRZ8XnH607pt6w" alt="" width="563"><figcaption></figcaption></figure>

Audiences or traits generated by your integrations are all to be found under the criteria group **EXTERNAL DATA**.\
For each integration, you will have a corresponding item that you can drag and drop to use.\
For global information on how to build a targeting segment, please refer to [how to create a segment](/web-experimentation-and-personalization/targeting-step/how-to-create-a-segment-who-section.md).

For an audience to be available in the segment builder it must not be empty, meaning that we have to identify at least one user belonging to that audience. Once a user is identified, the audience will appear in the segment builder.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.abtasty.com/integrations/pull-integrations/segment.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
