AcquisitionTraffic Breakdown

Traffic Breakdown

Return dated session and conversion counts by channel or campaign dimension. Defaults to daily buckets. For a 30-day example, use timeframe=custom&startDate=2026-10-01&endDate=2026-10-30&interval=day&breakdownMode=channels.

curl -X GET "https://api.hardal.ai/v1/reports/acquisition/traffic-breakdown?tenantId=123e4567-e89b-12d3-a456-426614174000&sourceId=123e4567-e89b-12d3-a456-426614174000&timeframe=today&startDate=example_string&endDate=example_string&timezone=example_string&interval=minute&attributionModel=first_touch&attributionWindowDays=example_string&conversionEventNames=%5B%22John%20Doe%22%5D&trafficScope=consented_traffic&breakdownMode=channels&campaignsBreakdownMode=all&aiFocus=true" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "data": [
    {
      "date": "2026-10-01",
      "sessions": 208,
      "conversions": 5,
      "breakdownKey": "Direct"
    },
    {
      "date": "2026-10-01",
      "sessions": 156,
      "conversions": 5,
      "breakdownKey": "OrganicSearch"
    },
    {
      "date": "2026-10-01",
      "sessions": 78,
      "conversions": 3,
      "breakdownKey": "PaidSearch"
    },
    {
      "date": "2026-10-01",
      "sessions": 52,
      "conversions": 1,
      "breakdownKey": "Referral"
    },
    {
      "date": "2026-10-01",
      "sessions": 26,
      "conversions": 0,
      "breakdownKey": "OrganicSocial"
    },
    {
      "date": "2026-10-02",
      "sessions": 240,
      "conversions": 6,
      "breakdownKey": "Direct"
    },
    {
      "date": "2026-10-02",
      "sessions": 180,
      "conversions": 6,
      "breakdownKey": "OrganicSearch"
    },
    {
      "date": "2026-10-02",
      "sessions": 90,
      "conversions": 4,
      "breakdownKey": "PaidSearch"
    },
    {
      "date": "2026-10-02",
      "sessions": 60,
      "conversions": 1,
      "breakdownKey": "Referral"
    },
    {
      "date": "2026-10-02",
      "sessions": 30,
      "conversions": 0,
      "breakdownKey": "OrganicSocial"
    },
    {
      "date": "2026-10-03",
      "sessions": 256,
      "conversions": 6,
      "breakdownKey": "Direct"
    },
    {
      "date": "2026-10-03",
      "sessions": 192,
      "conversions": 6,
      "breakdownKey": "OrganicSearch"
    },
    {
      "date": "2026-10-03",
      "sessions": 96,
      "conversions": 4,
      "breakdownKey": "PaidSearch"
    },
    {
      "date": "2026-10-03",
      "sessions": 64,
      "conversions": 1,
      "breakdownKey": "Referral"
    },
    {
      "date": "2026-10-03",
      "sessions": 32,
      "conversions": 0,
      "breakdownKey": "OrganicSocial"
    },
    {
      "date": "2026-10-04",
      "sessions": 240,
      "conversions": 6,
      "breakdownKey": "Direct"
    },
    {
      "date": "2026-10-04",
      "sessions": 180,
      "conversions": 6,
      "breakdownKey": "OrganicSearch"
    },
    {
      "date": "2026-10-04",
      "sessions": 90,
      "conversions": 4,
      "breakdownKey": "PaidSearch"
    },
    {
      "date": "2026-10-04",
      "sessions": 60,
      "conversions": 1,
      "breakdownKey": "Referral"
    },
    {
      "date": "2026-10-04",
      "sessions": 30,
      "conversions": 0,
      "breakdownKey": "OrganicSocial"
    },
    {
      "date": "2026-10-05",
      "sessions": 264,
      "conversions": 6,
      "breakdownKey": "Direct"
    },
    {
      "date": "2026-10-05",
      "sessions": 198,
      "conversions": 6,
      "breakdownKey": "OrganicSearch"
    },
    {
      "date": "2026-10-05",
      "sessions": 99,
      "conversions": 4,
      "breakdownKey": "PaidSearch"
    },
    {
      "date": "2026-10-05",
      "sessions": 66,
      "conversions": 1,
      "breakdownKey": "Referral"
    },
    {
      "date": "2026-10-05",
      "sessions": 33,
      "conversions": 0,
      "breakdownKey": "OrganicSocial"
    },
    {
      "date": "2026-10-06",
      "sessions": 264,
      "conversions": 6,
      "breakdownKey": "Direct"
    },
    {
      "date": "2026-10-06",
      "sessions": 198,
      "conversions": 6,
      "breakdownKey": "OrganicSearch"
    },
    {
      "date": "2026-10-06",
      "sessions": 99,
      "conversions": 4,
      "breakdownKey": "PaidSearch"
    },
    {
      "date": "2026-10-06",
      "sessions": 66,
      "conversions": 1,
      "breakdownKey": "Referral"
    },
    {
      "date": "2026-10-06",
      "sessions": 33,
      "conversions": 0,
      "breakdownKey": "OrganicSocial"
    },
    {
      "date": "2026-10-07",
      "sessions": 208,
      "conversions": 5,
      "breakdownKey": "Direct"
    },
    {
      "date": "2026-10-07",
      "sessions": 156,
      "conversions": 5,
      "breakdownKey": "OrganicSearch"
    },
    {
      "date": "2026-10-07",
      "sessions": 78,
      "conversions": 3,
      "breakdownKey": "PaidSearch"
    },
    {
      "date": "2026-10-07",
      "sessions": 52,
      "conversions": 1,
      "breakdownKey": "Referral"
    },
    {
      "date": "2026-10-07",
      "sessions": 26,
      "conversions": 0,
      "breakdownKey": "OrganicSocial"
    }
  ],
  "timestamp": "2026-11-01T09:30:00.000Z",
  "path": "/v1/reports/acquisition/traffic-breakdown",
  "requestId": "req_01JD2V8Q9Z6R4XK7T3M5N8P2WA"
}
GET
/v1/reports/acquisition/traffic-breakdown
GET
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

OAuth access token (token exchange) or organization API key.

OAuth access token (token exchange) or organization API key.
query
tenantIdstring
Required

UUID of the tenant to report on. Send it exactly once. GET /v1/workspace/access lists the tenants this credential can read.

Format: uuid
query
sourceIdstring

UUID of one source of the tenant. Omit it to include every source of the tenant.

Format: uuid
query
timeframestring

Reporting period. The presets today, yesterday, last7days and last30days cover whole calendar days ending today in the request timezone; last7days is today and the six days before it. Use custom together with startDate and endDate. Defaults to today.

query
startDatestring

First day of a custom period, YYYY-MM-DD, inclusive. Send it only with timeframe=custom, together with endDate.

query
endDatestring

Last day of a custom period, YYYY-MM-DD, inclusive. Send it only with timeframe=custom; it must not be before startDate.

query
timezonestring

IANA time zone name such as Europe/Istanbul or America/New_York. It sets the calendar-day boundaries of the period and of the time buckets. Defaults to Europe/Istanbul.

Min length: 1 • Max length: 100
query
intervalstring

Bucket size of trafficBreakdown. Defaults to day.

query
attributionModelstring

How a conversion is credited to a traffic source: first_touch credits the first visit, last_touch the last visit and last_non_direct_touch the last visit that was not direct. Defaults to the tenant's attribution setting.

query
attributionWindowDaysstring

How many days before a conversion a visit can receive credit: 7, 14 or 30. Defaults to the tenant's attribution setting.

Min: 7 • Max: 30
query
conversionEventNamesstring

Event names counted as conversions. Repeat the parameter or separate names with commas. Defaults to the tenant's conversion events; when none are configured, conversions are 0.

query
trafficScopestring

Which sessions to include by consent: consented_traffic, unconsented_traffic or all_traffic. Defaults to the tenant's saved scope. The parameter can narrow a saved all_traffic scope. If the tenant saves consented_traffic or unconsented_traffic, the saved scope applies.

query
breakdownModestring

Dimension of the trafficBreakdown series: channels or campaigns. source and medium are shorthand for campaigns broken down by that field. Defaults to channels.

query
campaignsBreakdownModestring

With breakdownMode=campaigns, break the series down by source, by medium or by both with all. Defaults to all.

query
aiFocusstring

true limits the report to traffic from AI assistants such as ChatGPT, Perplexity, Gemini, Claude and Copilot. Defaults to false.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. OAuth access token (token exchange) or organization API key.

Query Parameters

tenantIdstring
Required

UUID of the tenant to report on. Send it exactly once. GET /v1/workspace/access lists the tenants this credential can read.

sourceIdstring

UUID of one source of the tenant. Omit it to include every source of the tenant.

timeframestring

Reporting period. The presets today, yesterday, last7days and last30days cover whole calendar days ending today in the request timezone; last7days is today and the six days before it. Use custom together with startDate and endDate. Defaults to today.

startDatestring

First day of a custom period, YYYY-MM-DD, inclusive. Send it only with timeframe=custom, together with endDate.

endDatestring

Last day of a custom period, YYYY-MM-DD, inclusive. Send it only with timeframe=custom; it must not be before startDate.

timezonestring

IANA time zone name such as Europe/Istanbul or America/New_York. It sets the calendar-day boundaries of the period and of the time buckets. Defaults to Europe/Istanbul.

intervalstring

Bucket size of trafficBreakdown. Defaults to day.

attributionModelstring

How a conversion is credited to a traffic source: first_touch credits the first visit, last_touch the last visit and last_non_direct_touch the last visit that was not direct. Defaults to the tenant's attribution setting.

attributionWindowDaysstring | number

How many days before a conversion a visit can receive credit: 7, 14 or 30. Defaults to the tenant's attribution setting.

conversionEventNamesstring[] | string

Event names counted as conversions. Repeat the parameter or separate names with commas. Defaults to the tenant's conversion events; when none are configured, conversions are 0.

trafficScopestring

Which sessions to include by consent: consented_traffic, unconsented_traffic or all_traffic. Defaults to the tenant's saved scope. The parameter can narrow a saved all_traffic scope. If the tenant saves consented_traffic or unconsented_traffic, the saved scope applies.

breakdownModestring

Dimension of the trafficBreakdown series: channels or campaigns. source and medium are shorthand for campaigns broken down by that field. Defaults to channels.

campaignsBreakdownModestring

With breakdownMode=campaigns, break the series down by source, by medium or by both with all. Defaults to all.

aiFocusboolean | string

true limits the report to traffic from AI assistants such as ChatGPT, Perplexity, Gemini, Claude and Copilot. Defaults to false.

Responses

successboolean
Required
Allowed values:true
dataarray
Required
timestampstring
Required
pathstring
Required
requestIdstring
Required