---
title: "Get funnel analytics by referrer"
method: POST
path: "/funnels/getAnalyticsByReferrer"
tags: ["Funnels"]
---

# Get funnel analytics by referrer

`POST /funnels/getAnalyticsByReferrer`

## Request

- Base URL: `https://api.databuddy.cc`
- URL: `https://api.databuddy.cc/funnels/getAnalyticsByReferrer`
- Auth: API key in header `x-api-key`

Returns funnel analytics broken down by referrer. Requires website read permission.

## Request body

- object
  - `startDate` string, date
  - `endDate` string, date
  - `cohort` object: Read-only cohort. Funnel filters select first-step visitors; subsequent ordered steps may have different context. Goal filters select page-view visitors and matching completions. Saved filters are ANDed. Use the referrer breakdown tool to compare source groups. These are visitors, not attempts.
    - `filters` object[], required
      - `field` 'browser_name' | 'device_type' | 'os_name' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign', required
      - `operator` 'equals' | 'not_equals' | 'in' | 'not_in', required
      - `value` union, required
        - string
        - string[]
  - `funnelId` string, required
  - `websiteId` string, required

## Response `200`

OK

- object
  - `referrer_analytics` object[], required
    - `referrer` string, required
    - `referrer_parsed` object, required
      - `name` string, required
      - `type` string, required
      - `domain` string, required
    - `total_users` number, required
    - `completed_users` number, required
    - `conversion_rate` number, required
  - `measurement` object, required
    - `websiteId` string, required
    - `definitionId` string, required
    - `startDate` string, date, required
    - `endDate` string, date, required
    - `definition` union, required
      - object
        - `type` 'PAGE_VIEW' | 'EVENT' | 'CUSTOM', required
        - `target` string, required
        - `filters` object[]
          - `field` 'event_name' | 'path' | 'referrer' | 'country' | 'city' | 'device_type' | 'browser_name' | 'os_name' | 'language' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'utm_term' | 'utm_content' | 'user_agent' | 'screen_resolution', required
          - `operator` 'equals' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'not_equals' | 'in' | 'not_in', required
          - `value` union, required
            - string
            - string[]
      - object
        - `steps` object[], required
          - `type` 'PAGE_VIEW' | 'EVENT' | 'CUSTOM', required
          - `target` string, required
          - `name` string, required
          - `conditions` object
        - `filters` object[]
          - `field` 'event_name' | 'path' | 'referrer' | 'country' | 'city' | 'device_type' | 'browser_name' | 'os_name' | 'language' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'utm_term' | 'utm_content' | 'user_agent' | 'screen_resolution', required
          - `operator` 'equals' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'not_equals' | 'in' | 'not_in', required
          - `value` union, required
            - string
            - string[]
  - `savedDefinition` union, required
    - object
      - `type` 'PAGE_VIEW' | 'EVENT' | 'CUSTOM', required
      - `target` string, required
      - `filters` object[]
        - `field` 'event_name' | 'path' | 'referrer' | 'country' | 'city' | 'device_type' | 'browser_name' | 'os_name' | 'language' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'utm_term' | 'utm_content' | 'user_agent' | 'screen_resolution', required
        - `operator` 'equals' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'not_equals' | 'in' | 'not_in', required
        - `value` union, required
          - string
          - string[]
    - object
      - `steps` object[], required
        - `type` 'PAGE_VIEW' | 'EVENT' | 'CUSTOM', required
        - `target` string, required
        - `name` string, required
        - `conditions` object
      - `filters` object[]
        - `field` 'event_name' | 'path' | 'referrer' | 'country' | 'city' | 'device_type' | 'browser_name' | 'os_name' | 'language' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'utm_term' | 'utm_content' | 'user_agent' | 'screen_resolution', required
        - `operator` 'equals' | 'contains' | 'not_contains' | 'starts_with' | 'ends_with' | 'not_equals' | 'in' | 'not_in', required
        - `value` union, required
          - string
          - string[]
  - `cohort` object: Read-only cohort. Funnel filters select first-step visitors; subsequent ordered steps may have different context. Goal filters select page-view visitors and matching completions. Saved filters are ANDed. Use the referrer breakdown tool to compare source groups. These are visitors, not attempts.
    - `filters` object[], required
      - `field` 'browser_name' | 'device_type' | 'os_name' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign', required
      - `operator` 'equals' | 'not_equals' | 'in' | 'not_in', required
      - `value` union, required
        - string
        - string[]

## Other responses

- `400`: 400
- `401`: 401
- `402`: 402
- `403`: 403
- `404`: 404
- `409`: 409
- `429`: 429
- `500`: 500
- `503`: 503

---

[API](https://skmtc.dev/databuddy/apis/databuddy-api.md) - [All operations](https://skmtc.dev/databuddy/apis/databuddy-api/llms.txt) - [OpenAPI document](https://skmtc.dev/databuddy/apis/databuddy-api/revisions/ddfbba648d52?raw)
