---
title: "Compute journey funnel analysis"
method: POST
path: "/api/v2/product-analytics/journey/funnel"
tags: ["Product Analytics"]
---

# Compute journey funnel analysis

`POST /api/v2/product-analytics/journey/funnel`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/product-analytics/journey/funnel`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token`
- TypeScript: <https://skmtc.dev/datadog/apis/datadog-api-v2-collection/docs/api/v2/product-analytics/journey/funnel/post.ts> (a function with typed inputs; its response is checked against the schema)

Compute a funnel over an ordered sequence of Product Analytics events.
Returns the per-step conversion counts, conversion rates, and elapsed times,
optionally segmented by group-by facets.

## Request body

- ProductAnalyticsJourneyFunnelRequest: Request body for a journey funnel analysis.
  - `data` ProductAnalyticsJourneyFunnelRequestData, required: The single JSON:API resource carrying a funnel query. Its attributes hold the time window to query and the journey whose step-to-step conversion should be measured.
    - `attributes` ProductAnalyticsJourneyFunnelRequestAttributes, required: Attributes of a journey funnel request.
      - `exclude_anonymous_traffic` boolean: Whether to exclude sessions that are not tied to an identified user.
      - `from` integer, required: Start of the query window, in epoch milliseconds.
      - `query` ProductAnalyticsJourneyFunnelQuery, required: Query definition for a journey funnel request.
        - `compute` ProductAnalyticsJourneyFunnelCompute: Defines the metric computed at each funnel step.
          - `aggregation` string: Aggregation function: `count`, `cardinality`, `avg`, `median`, `min`, `max`, `sum`, or a percentile of the form `pc<N>` such as `pc95`. Defaults to `cardinality`.
          - `metric` string: Metric to aggregate on. Defaults to the identity join key.
        - `group_by` ProductAnalyticsGraphQueryGroupBy[]: Segments the funnel by the values of one or more facets.
          - `facet` string, required: Attribute path to group by.
          - `limit` integer: Maximum number of groups to return. Omit it to let the service choose.
          - `should_exclude_missing` boolean: Whether to exclude entities that have no value for this facet.
          - `sort` ProductAnalyticsGroupBySort: Sort configuration for group-by results.
            - `aggregation` string: The aggregation function to sort by.
            - `metric` string: The metric to sort by.
            - `order` 'asc' | 'desc': Direction of sort.
          - `source` 'product_analytics_audience_filters.users' | 'product_analytics_audience_filters.accounts': Audience dimension to group by, instead of an event facet.
          - `target` union: A reference to a step, or a range of steps, in the journey. Use a `node` target to name a single step, or a `path` target to name the range between two steps.
            - ProductAnalyticsJourneyNodeTarget: A reference to a single step of the journey.
              - …
            - ProductAnalyticsJourneyPathTarget: A reference to the range of steps between two nodes of the journey.
              - …
          - `value_filters` string[]: Restricts the results to these facet values.
        - `search` ProductAnalyticsJourneySearch, required: Defines the steps of the journey and the filters applied to it.
          - `expression` string, required: Expression combining the node aliases in order, for example `A -> B -> C`.
          - `filters` ProductAnalyticsJourneySearchFilters: Filters applied on top of the journey step expression.
            - `audience_filters` ProductAnalyticsJourneyAudienceFilters: Restricts the journey to an audience built from named sub-queries. Sub-query names must be unique across `users`, `segments`, and `accounts`.
              - …
            - `graph_filters` ProductAnalyticsJourneySearchGraphFilter[]: Filters on journey-level metrics such as time to convert.
              - …
            - `string_filter` string: Free-text search query applied to the whole journey.
          - `join_keys` ProductAnalyticsJoinKeys: Identity join keys used to stitch events belonging to the same user or session.
            - `primary` string: Primary identity join key. Defaults to `@session.id`.
            - `secondary` string[]: Additional identity join keys.
          - `node_objects` object, required: Map of node alias to the query matching that step of the journey. Every alias used in `expression` must have an entry here.
      - `to` integer, required: End of the query window, in epoch milliseconds.
    - `type` 'journey_request', required: The resource type identifier for a journey funnel request.

## Response `200`

OK

- ProductAnalyticsJourneyFunnelResponse: Response for a journey funnel analysis.
  - `data` ProductAnalyticsJourneyFunnelResponseData, required: The single JSON:API resource holding a computed funnel. Its attributes contain the number of entities that entered, the end-to-end conversion, and one entry per funnel step.
    - `attributes` ProductAnalyticsJourneyFunnelResponseAttributes, required: Attributes of a journey funnel response.
      - `end_to_end_conversion_rate` number, double, required: Conversion rate from the first step to the last step.
      - `end_to_end_elapsed_time` ProductAnalyticsElapsedTime, required: Elapsed time statistics (min/max/avg in milliseconds).
        - `avg` integer, required: Average elapsed time to reach the next step, in milliseconds.
        - `max` integer, required: Maximum elapsed time to reach the next step, in milliseconds.
        - `min` integer, required: Minimum elapsed time to reach the next step, in milliseconds.
      - `funnel_steps` ProductAnalyticsJourneyFunnelStep[], required: The funnel steps, in the order given by the search expression.
        - `elapsed_time_to_next_step` ProductAnalyticsElapsedTime, required: Elapsed time statistics (min/max/avg in milliseconds).
          - `avg` integer, required: Average elapsed time to reach the next step, in milliseconds.
          - `max` integer, required: Maximum elapsed time to reach the next step, in milliseconds.
          - `min` integer, required: Minimum elapsed time to reach the next step, in milliseconds.
        - `groups` ProductAnalyticsJourneyFunnelStepGroup[], required: Breakdown of this step by the requested group-by facets.
          - `conversion_count` integer, required: Number of entities in this group that reached the next step.
          - `elapsed_time_to_next_step` ProductAnalyticsElapsedTime, required: Elapsed time statistics (min/max/avg in milliseconds).
            - `avg` integer, required: Average elapsed time to reach the next step, in milliseconds.
            - `max` integer, required: Maximum elapsed time to reach the next step, in milliseconds.
            - `min` integer, required: Minimum elapsed time to reach the next step, in milliseconds.
          - `group_tags` string[], required: Group-by values identifying this cohort.
          - `value` number, double, required: Value of the computed metric for this group at this step.
        - `label` string, required: Label of the step, derived from the node alias.
        - `unit` string, required: Unit of the elapsed time values.
        - `value` number, double, required: Value of the computed metric at this step.
      - `initial_count` integer, required: Number of entities that entered the funnel.
    - `id` string, required: Identifier of this result.
    - `type` 'funnel_response', required: The resource type identifier for a journey funnel response.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v2-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v2-collection/revisions/3f70db624329?raw)
