---
title: Segments
description: Analyze and understand segments of your user base.
breadcrumbs: Docs > Product Analytics > Segments
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Segments

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com, us2.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site.md). ({% placeholder "user-datadog-site-name" /%}).
{% /alert %}

{% /callout %}

## Overview{% #overview %}

Segmenting helps you focus on specific groups of users or accounts based on characteristics or behaviors. This allows you to uncover insights, identify trends, and make data-driven decisions about your product.

For example, you can segment users by purchase amount, by activity within a specific country, or by trial status. You can also segment accounts by attributes like annual recurring revenue (ARR) or start date.

After creating a segment, you can reuse it across charts and dashboards to compare how different groups behave.

## Build a segment{% #build-a-segment %}

To create a segment:

1. Navigate to [Digital Experience Monitoring > Product Analytics > Users > Segments](https://app.datadoghq.com/product-analytics/segments) and click Create Segment.

1. Replace New Segment with a name for the segment. Optionally, click Add a description.

1. Next to Show, use the toggle to choose the type of profiles to include in the segment:

   - Users: Create a segment of individual users.
   - Accounts: Create a segment of accounts (organizations). See the Account segments section.
Important alert (level: info): A segment returns either user or account profiles, not both.
1. Add one or more filters:

   - Add Property: Match users or accounts by attribute, such as email, last seen, or any custom attributes you've imported. See the Filter by properties and events section.
   - Add Event: Match users or accounts by what they did over the time frame you choose. Use a single event, or a multistep funnel that users converted through or dropped off from. See Filter by properties and events.
   - Import CSV: Match a list you already have by uploading a CSV file of IDs to include or exclude. See the Import a CSV file section.

Filters combine with AND. To exclude matches instead, change any filter's operator, such as **did** to **did not**.

   {% image
      source="https://docs.dd-static.net/images/product_analytics/segmentation/segment_editor.e3767a3be35118b8241f68d2a7c49199.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/product_analytics/segmentation/segment_editor.e3767a3be35118b8241f68d2a7c49199.png?auto=format&fit=max&w=850&dpr=2 2x"
      alt="The Create Segment page with a segment name field, a Show setting, and buttons to add a property, an event, or a CSV import." /%}

1. Click Save Segment.

{% collapsible-section #segment-pana %}
### Filter by properties and events

Combine property and event filters to focus on the users you care about:

- **Property filters** match users by attribute, such as country, plan, or signup date, including any custom attributes you've imported. For example, `have the property plan is premium`. To import custom attributes, see [User and Account Profiles](https://docs.datadoghq.com/product_analytics/profiles.md).
- **Event filters** match users by what they did over a time frame you choose. Use a single event, or click Add step to build a multi-step funnel that users converted through or dropped off from. For example, `did convert after Sign up → Start trial`. To narrow an event by its attributes, such as country or device type, click Add filter.

As you add filters, the Dynamic segment preview lists the users who match.

For example, to segment users in Brazil who clicked the **In Stock** button in the past three months:

1. Click Add Event and select the `"In Stock" Clicked` action.
1. Set the time frame to Past 3 Months.
1. Click Add filter and filter by `Country is Brazil`.

{% image
   source="https://docs.dd-static.net/images/product_analytics/segmentation/pana_example_checkout_brazil.5c879b8dbf36c7c25a8819ec5b464d0c.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/product_analytics/segmentation/pana_example_checkout_brazil.5c879b8dbf36c7c25a8819ec5b464d0c.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A segment of users in Brazil who clicked In Stock in the past three months, with a preview of matching users." /%}

#### Example: Find users who left before buying{% #example-find-users-who-left-before-buying %}

To find mobile users who viewed their cart but didn't check out:

1. Click Add Event and select the `Cart` view.
1. Click Add step, choose then did not, and select the `Checkout Button Clicked` action.
1. Set the time frame, such as within **1 Day**, anytime in the Past 1 Day.
1. Click Add Property and filter by `Last Device Type is Mobile`.

{% image
   source="https://docs.dd-static.net/images/product_analytics/segmentation/user_profile_example_3.a20fe01bb9c6731bdc5d95af5b2ed8f8.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/product_analytics/segmentation/user_profile_example_3.a20fe01bb9c6731bdc5d95af5b2ed8f8.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A segment of mobile users who viewed Cart but didn't click checkout within one day, with a preview of matching users." /%}

You can also start from the [User Profiles](https://app.datadoghq.com/product-analytics/profiles) page. Filter your users, then click Create Segment. The segment editor opens with your filters already applied.
{% /collapsible-section %}

{% collapsible-section #segment-csv %}
### Import a CSV file

If you have a list of users from a survey, experiment, or CRM, upload it as a CSV file to turn it into a segment.

To create a segment from your own file:

1. Click Import CSV and upload your CSV file.
1. Next to column, select the column in your file that holds user IDs or emails, such as `id`.
1. Next to with, select the Product Analytics attribute to match, such as User Id (@usr.id).
1. To exclude the users in the file instead, click matching and select not matching the filter into an exclusion.

The file needs a column with user IDs or user emails that match the `usr.id` or `usr.email` attribute in Product Analytics.

{% image
   source="https://docs.dd-static.net/images/product_analytics/segmentation/segment_link_csv_1.b777fe8a2e8f4c627c9cbc3bb72afdd2.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/product_analytics/segmentation/segment_link_csv_1.b777fe8a2e8f4c627c9cbc3bb72afdd2.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="A CSV import filter that reads: who are matching column id from segment-test-users.csv with User Id (@usr.id). The filter is highlighted." /%}

{% /collapsible-section %}

{% collapsible-section #segment-accounts %}
### Account segments

Account segments group accounts, such as organizations or companies, based on their attributes or the events their users performed. Use them to analyze groups such as accounts with ARR over a specific amount or accounts that adopted a specific feature.

To create an account segment:

1. Next to Show, switch the toggle from Users to Accounts.
1. Add one or more filters:
   - Add Property: Filter by account properties such as ARR, start date, account IDs, or any imported account attributes. To import custom attributes, see [User and Account Profiles](https://docs.datadoghq.com/product_analytics/profiles.md).
   - Add Event: Include accounts where at least one user performed the specified event.
   - Import CSV: Upload a CSV file with a column of account IDs. The IDs map to the account ID attribute in Product Analytics.
1. Click Save Segment.

{% /collapsible-section %}

## Use segments across Product Analytics{% #use-segments-across-product-analytics %}

You can filter any Product Analytics view by a segment, including Pathways, Analytics Explorer, Funnels, and Retention.

To filter a view by a segment:

1. Click Add filter.
1. Select the Segments tab, and choose a segment. If a segment isn't listed, click Create new segment.

{% image
   source="https://docs.dd-static.net/images/product_analytics/segmentation/segments_from_pana.c74df1bc551e4d874408f40e6f04bb21.png?auto=format&fit=max&w=850 1x, https://docs.dd-static.net/images/product_analytics/segmentation/segments_from_pana.c74df1bc551e4d874408f40e6f04bb21.png?auto=format&fit=max&w=850&dpr=2 2x"
   alt="The Add filter menu open on a Product Analytics page, with the Segments tab highlighted and a list of saved segments to choose from." /%}

## Further reading{% #further-reading %}

Additional helpful documentation, links, and articles:

- [Product Analytics](https://docs.datadoghq.com/product_analytics.md)
- [Getting Started with Product Analytics](https://learn.datadoghq.com/courses/getting-started-product-analytics)
- [Investigate account-level churn risk with Product Analytics account segments](https://www.datadoghq.com/blog/product-analytics-account-segments/)
