Analytics conversion attribution
run_ga4_attributionShow which channels, campaigns or sources get the credit for conversions under GA4's attribution models, or compare data-driven with last click.
The view of GA4's Advertising workspace: conversions, revenue, ad cost and ROAS per channel (or campaign, source, country, device) attributed by the model, not by session. attribution_model COMPARE runs data-driven and last click side by side and returns each row's share of the credit under both and the shift in percentage points, with insights naming the channels that gain or lose most. Conversions can be named by key event name; empty means all. Uses the GA4 Data API v1alpha (runReport with a conversion spec), which Google is still rolling out: a property without it gets an explanation and the fallback. Ad cost and ROAS need Google Ads linked to the property.
Google Analytics Data API: https://developers.google.com/analytics/devguides/reporting/data/v1 and Admin API: https://developers.google.com/analytics/devguides/config/admin/v1
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "run_ga4_attribution"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum rows per model. | |
| metrics | No | Any of allConversionsByConversionDate, allConversionsByInteractionDate, totalRevenueByConversionDate, totalRevenueByInteractionDate, advertiserAdCost, advertiserAdClicks, advertiserAdImpressions, advertiserAdCostPerClick, advertiserAdCostPerAllConversionsByConversionDate, advertiserAdCostPerAllConversionsByInteractionDate, returnOnAdSpendByConversionDate, returnOnAdSpendByInteractionDate. Default: conversions, revenue, ad cost and ROAS by conversion date. | |
| dimensions | No | Any of campaignName, continent, country, defaultChannelGroup (default), deviceCategory, medium, platform, primaryChannelGroup, source, sourceMedium, sourcePlatform, subcontinent. | |
| conversions | No | Key event names (e.g. ["purchase"]) or GA4 conversion action IDs ("conversionActions/123"); empty for all. | |
| property_id | No | GA4 property as "properties/123456789" or the bare numeric ID. If empty, uses the default from config. | |
| date_range_end | No | Same formats. | today |
| date_range_start | No | "today", "yesterday", "NdaysAgo" or "YYYY-MM-DD". | 28daysAgo |
| attribution_model | No | DATA_DRIVEN (default), LAST_CLICK, or COMPARE. | DATA_DRIVEN |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||