Get attribution
get_attributionGet revenue and conversions for one site over a date range, broken down by traffic source, campaign, ad set, or ad, using PixelFlow's website attribution (the UTM tags and referrer of the converting visit). Each row has its event counts, revenue, unique visitors, and sessions. To drill down, pass the parent levels: campaign needs source; adset needs source and campaign; ad needs all three. Ranges before the plan's analytics lookback are refused, and a range too large to read at once is refused as range_too_wide with the largest range that fits. Use it for "which campaigns or ads drove conversions" questions.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"site_id": "<site_id>",
"from": "<from>",
"to": "<to>"
},
"name": "get_attribution"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | Range end. YYYY-MM-DD means the end of that day in `timezone`, so the whole day is included; a full ISO 8601 timestamp is used as is. | |
| from | Yes | Range start. YYYY-MM-DD means the start of that day in `timezone`; a full ISO 8601 timestamp is used as is. | |
| adset | No | Parent ad set key. Required for ad. | |
| source | No | Parent source key from a previous result, such as facebook. Names are in list_supported_values's `sources`; (not set) for a blank source. Required for campaign, adset, and ad. | |
| site_id | Yes | Site to act on, as returned by list_sites. | |
| campaign | No | Parent campaign key. Required for adset and ad. | |
| group_by | No | Breakdown level. Default source. | |
| timezone | No | IANA time zone such as Europe/Berlin. Default UTC. Returned times and day buckets use it. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | One row per source, campaign, ad set, or ad. | |
| window | Yes | Exact range read, after applying timezone. | |
| group_by | Yes | Breakdown level used. | |
| timezone | Yes | IANA time zone used for dates and times. UTC when none was passed. | |
| event_count | Yes | Sum of total_events across rows. | |
| attributed_revenue | Yes | Revenue in the site currency: `amount` (number), `currency` (string or null), `events` (integer). | |
| revenue_tracked_since | Yes | Set when the range starts before PixelFlow began recording attribution revenue: revenue before this date is not counted. | |
| excluded_valued_events | Yes | Valued conversions in another currency, left out of the revenue. |