gads_get_custom_column_report
Google Ads read low risk
Part of the Google Ads Manager Agent.
What it does
Compute a Google Ads custom column from the user's own formula, with Google's live numbers. Google's API cannot read the custom columns made in the Google Ads UI, nor their formulas, so ask the user for the formula (Google Ads: Columns, Custom columns, the pencil icon) or use one they gave earlier in this chat; never guess a formula from a column's name. Give it as definition: named terms, each a metric (cost, clicks, impressions, interactions, conversions, conversions_value, all_conversions, all_conversions_value, the four by_conversion_date versions, view_through_conversions), optionally limited to conversion_actions by their exact names, plus a formula over the term names with + - * / and parentheses. Each term is summed per row, then the formula is applied to those totals, as Google Ads does for a period. Terms limited by conversion action come from a second query, because Google keeps cost apart from the per-action split. Returns {column, formula, format, date_range, by, total:{value, terms}, rows:[{campaign or date/week/month, value, terms}], conversion_actions}; each term's total is shown so the user can check it against the UI. Read-only.
When to use it
Use when the user asks for a custom column they made in Google Ads (a ROAS or cost per result over chosen conversion actions, for example), by account, campaign or period.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | Google Ads account, 10 digits (dashes allowed). Not a manager account. |
definition | object | yes | The custom column as the user wrote it in Google Ads: {"name": "Android ROAS", "terms": {"subs": {"metric": "conversions_value", "conversion_actions": ["<exact action name>"]}, "cost": {"metric": "cost"}}, "formula": "subs / cost", "format": "ratio"}. format: ratio, percent, money or number. Up to 20 terms. |
date_range | string | no | LAST_7_DAYS, LAST_14_DAYS, LAST_30_DAYS (default), any LAST_N_DAYS, THIS_MONTH, LAST_MONTH, YESTERDAY or 'YYYY-MM-DD,YYYY-MM-DD', in the account's time zone. |
by | string | no | none (default: one total), campaign, date, week (Monday weeks, as the UI) or month. |
campaign_id | string | no | Limit to one campaign (its number, from gads_list_campaigns). |
limit | integer | no | Rows shown, 1 to 500 (default 200); total always counts every row. |
Safeguards
Policy
Never fabricate or approximate a metric: compute only the formula the user gave, from the numbers Google returns, and match the Google Ads UI within +/-1%. Never guess a custom column's formula from its name. Read only the account the authenticated user may see; never another tenant's.
Reminder
Say the result is Scalix's computation of the user's formula from Google's numbers, show each term's total, and ask the user to compare one period with the UI column.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
invalid_argument | The definition is malformed, a formula uses something other than + - * / and term names, a conversion action name is not in the account (the message lists its actions), or cost was given conversion_actions. | Fix the definition as the message says and call again; ask the user for the exact action names if needed. | no |
result_too_large | Google returned more rows than Scalix folds (500,000); nothing was cut. | Narrow date_range, pass campaign_id or use a coarser by. | no |
permission_denied | The account is not enabled for Claude or this login cannot read it. | Enable the account in the Scalix console, or use one gads_list_accessible_customers shows. | no |
Edge cases
- A value is null where the formula divides by 0 (a row with no cost); the UI shows a dash there.
- A conversion action with no conversions in the period adds 0; an action name the account does not have is refused.
- Device, network and other segment filters inside a term are not supported yet; say so rather than approximate.