> ## Documentation Index
> Fetch the complete documentation index at: https://www.edgee.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Segment

> Segment is a customer data platform (CDP) that helps you collect, clean, and activate your customer data, **now at the edge**.

<img src="https://mintcdn.com/edgee/enlt_qUyIUJ64Dg-/images/banners/segment.png?fit=max&auto=format&n=enlt_qUyIUJ64Dg-&q=85&s=ef2002de8eb044190a23fa4e5bd74919" className="rounded-lg" noZoom width="1312" height="334" data-path="images/banners/segment.png" />

Find it on GitHub: [<Icon icon="github" iconType="solid" /> /edgee-ai/segment-component](https://github.com/edgee-ai/segment-component)

Segment's powerful customer data platform is now fully integrable with Edgee, allowing you to centralize your data collection
and analytics seamlessly at the edge. This component eliminates the need to embed Segment's script directly on your website,
significantly improving site performance and adhering to strict privacy standards.

## Event Mapping

Here's how Edgee events map to Segment events:

| Edgee event | Segment Event |
| ----------- | ------------- |
| Page        | `page`        |
| Track       | `track`       |
| User        | `identify`    |

<Note>
  When you make a `user` call, Edgee will send an `identify` event to Segment.
  Additionally, the user's data (user\_id, anonymous\_id, and properties) are stored on the device,
  enabling proper attribution for subsequent page views and events.
</Note>

## Getting Started

**To integrate Segment with your project on Edgee:**

1. Log in first to your Segment account and create a new source for your project. 🚨**WARNING** Your source has to be a `HTTP API` source.
2. Copy the `Write Key` from the Segment dashboard. <br />
   *(Your Write Key can be found under the source Settings > API Keys)*
3. Open the Edgee console and navigate to your project's Components.
4. Select "Add a component" and choose `edgee/segment` from the list of available components.
5. Enter your Segment `Write Key` and click Save.
6. With this setup, you're ready to transmit events directly to Segment, leveraging the edge's power for your analytics.

## Destination Name

When configuring your **Edgee Data Layer** or making SDK calls, use `edgee/segment` as the component name:

```json theme={"dark"}
{
  "components": {
    "edgee/segment": true
  }
}
```

For more details on Segment implementation, refer to the
[official Segment documentation](https://segment.com/docs/).
