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

# Segment integration guide

> Use Segment website and product events in Unify.

## Overview

Available only on Business plans.

Forward Segment events to Unify to use website visits and product activity in
[audiences](https://docs.unifygtm.com/reference/lists/create-an-audience.md) and [plays](https://docs.unifygtm.com/reference/plays/overview.md).
Unify supports Segment Page, Track, and Identify events. Identify events can
associate activity with a person using their email address.

You need a working Segment source and permission to configure its destinations.
Send each event through one source: forwarding the same pageview through Segment
and the Unify Intent client can double-count it.

## Connect Segment

**1. Get your Unify write key**

Open [Settings → Integrations → Segment](https://app.unifygtm.com/dashboard/settings/data/integrations/segment).
Click **Setup** if you haven't generated a write key, then copy the key.

**2. Create a Webhooks destination**

In Segment, open **Connections → Destinations** and click **Add destination**.
Search for **Webhooks (Actions)** and add it. Select the source whose events
you want to forward, then click **Next**.

Name the destination, select **Fill in settings manually**, and click
**Create destination**.

**3. Choose the events to send**

Open **Mappings**, click **New Mapping**, and choose the **Send** action.
Under **Define event trigger**, add Event Type conditions for **Page**,
**Track**, and **Identify**, using **any** so each type can match.

Omit an event type if you don't want to forward it. You can add more filters
to narrow the activity sent to Unify.

**4. Configure the webhook**

Under **Map fields**, use these values:

| Field | Value |
| - | - |
| URL | `https://analytics.unifygtm.com/api/v1/webhooks/segment` |
| Method | `POST` |
| Data | `$event` (the complete event) |
| Enable Batching | Disabled |

Add two entries under **Headers**. Segment places the value on the left and
the header name on the right:

| Value | Header name |
| - | - |
| Your Unify write key | `X-Write-Key` |
| `application/json` | `Content-Type` |

Keep batching disabled so each request contains one event.

![Segment webhook mapping with the Unify endpoint, POST method, placeholder write key, JSON content type, and complete event payload.](https://mintcdn.com/unify-19/LAWiWdEn3kIw0UN0/images/reference/integrations/segment/segment-webhook-mapping.png?fit=max\&auto=format\&n=LAWiWdEn3kIw0UN0\&q=85\&s=7d5bb7e17b3044f1f71e239b4a07a9d6)

**5. Test the mapping**

Generate or load a sample Page, Track, or Identify event. Under **Send test
record**, send the test event and check Segment's delivery result.

Review the event in the
[Unify event console](https://app.unifygtm.com/dashboard/settings/data/web-intent?webEventsTab=Events),
allowing a few minutes for processing. Finish saving the mapping and enable
the destination when its test data is correct.

## Use incoming events

Page events supply website visits, Track events supply named custom activity,
and Identify events associate visitors with known people. Include the person's
email in Identify traits so Unify can make that association.

For example, combine a recent pricing page visit with company size and CRM
status in the [filter builder](https://docs.unifygtm.com/reference/filter-builder.md#filter-by-website-and-event-data).
Save an audience to keep that group current, then use a play to follow up when
new records qualify.

## Troubleshooting

> [accordion] Segment reports a failed delivery
>
> Check the endpoint, POST method, write key, and `application/json` header.
> Confirm that Data contains the complete event and batching is disabled.

> [accordion] Delivery succeeds but the event is missing
>
> Confirm the event type is Page, Track, or Identify and allow a few minutes
> for processing. Then check the event console's date range and source.

> [accordion] Visits appear more than once
>
> Check whether the same activity is being forwarded through multiple
> destinations or collected by both Segment and the Unify Intent client.
> Keep one path for each event.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.