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

# Segment App

> Install the official Segment app to send payment, subscription, refund, and dispute events from Dodo Payments to Segment. Connect with your Write Key and choose the events.

## What the Segment app does

The Segment app sends events from your business to Segment. Each event has a name like `dodo_payment_succeeded`. You select the events and the filters.

> [!NOTE]
>
> To send events to Segment through your webhook endpoint and your transformation code, use the [Segment webhook connector](https://docs.dodopayments.com/integrations/segment.md).

## Before you start

* You are an owner or an admin of the Dodo Payments business.
* You have a Segment HTTP API source and its write key.

## Install, connect, and configure

**1. Install the app**

Open **Apps**, then **Explore**. Open **Segment** (publisher **Dodo Payments**) and select **Install app**.

**2. Connect Segment**

Select **Connect**. Enter the **Region**: leave it empty for the US, or enter `eu` for the EU. Paste the write key of a Segment HTTP API source. Leave the password empty. Then select **Connect**. Dodo Payments sends the event `dodo_payments_connected` one time.

![The Connect Segment dialog with the Region field and the Write Key field](https://mintcdn.com/dodopayments/9p5nlYkB8XwTy1ds/images/app-marketplace/merchant/apps/segment-3.png?fit=max\&auto=format\&n=9p5nlYkB8XwTy1ds\&q=85\&s=56e2b008443cfab16825c0be2ab3c5ef)

Segment has no request to read a key. Thus Dodo Payments cannot check the key when you connect. A bad key makes the deliveries fail.

**3. Choose the events**

Open the **Configure** tab. Turn on the events that you need.

![The Configure tab of the Segment app with the event switches, the user ID setting, and the unsaved changes bar](https://mintcdn.com/dodopayments/9p5nlYkB8XwTy1ds/images/app-marketplace/merchant/apps/segment-1.png?fit=max\&auto=format\&n=9p5nlYkB8XwTy1ds\&q=85\&s=5e2f59a441bf4a46b78f42cad371a0bf)

**4. Set the filters and save**

Scroll down. Select the products and currencies, and enter a minimum amount if you need one. Then select **Save**.

![The Products, Currencies, and Minimum amount filters on the Configure tab of the Segment app](https://mintcdn.com/dodopayments/9p5nlYkB8XwTy1ds/images/app-marketplace/merchant/apps/segment-2.png?fit=max\&auto=format\&n=9p5nlYkB8XwTy1ds\&q=85\&s=ab68d97c085043003a2303104e90a252)

## Settings

| Setting | What it does | Default |
| - | - | - |
| Send payment events | Sends `dodo_payment_succeeded` with the revenue fields for each successful payment. | On |
| Send subscription events | Sends one event for each subscription status change, for example `dodo_subscription_active`. | On |
| Send refund events | Sends `dodo_refund_succeeded` for each successful refund. | Off |
| Send dispute events | Sends `dodo_dispute_opened` for each new dispute. | Off |
| Segment user ID | The customer value that identifies the user: **Customer email**, **Dodo customer ID**, or **Metadata key**. | Customer email |
| Metadata key for the user ID | The customer metadata key to use when you select **Metadata key**. Use letters, numbers, underscore, or hyphen. Maximum 64 characters. | Empty |
| Products | Send events only for these products. | All products |
| Currencies | Send events only in these currencies. | All currencies |
| Minimum amount | Send events only from this amount. Use a whole number in the main unit of the currency, for example 10 for 10.00 USD. | No minimum |

## What is sent and when

Dodo Payments sends one Segment event for each Dodo Payments event, after the event happens. The user ID of each event is the customer email, unless you select a different value. A payment event also sends the revenue and the currency.

The event properties are the object ID, the customer ID, the product IDs, the amount, the currency code, the status, and the mode. The events contain no card data, no address, and no customer name. The app sets the IP address to 0.0.0.0, so Segment does not find a location. Each event has a fixed ID, so a retry does not add a copy.

The app sends no identify call, so it does not update user profiles.

## Test the app

**1. Use test mode**

Install and connect the app in test mode. Turn on **Send payment events**.

**2. Make a test payment**

Create a test payment.

**3. Check Segment**

Open the live event view of your Segment project. A `dodo_payment_succeeded` event appears.

## Troubleshooting

| Problem | What to do |
| - | - |
| No events arrive | Check that the event switch is on, that the filters do not skip the event, and that the key and the region are correct. Select **Update connection** and enter the key again. |
| **Connection needs attention** | Segment stopped accepting the key. Select **Reconnect** and enter a new key. |
| A customer has no events | Check the user ID setting. If the customer has no value for it, Dodo Payments skips the event. |

## Disconnect and uninstall

Turn off the events on the **Configure** tab to stop sending data. Uninstall the app to delete the Segment connection. See [Manage and uninstall](https://docs.dodopayments.com/features/app-marketplace/manage-and-uninstall.md).

![The Installed tab of the Apps page with Segment in the list and the status Active](https://mintcdn.com/dodopayments/9p5nlYkB8XwTy1ds/images/app-marketplace/merchant/apps/segment-4.png?fit=max\&auto=format\&n=9p5nlYkB8XwTy1ds\&q=85\&s=a5989eeecac3204d288997c12f4c11fa)


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