gads_get_placement_report
Google Ads read low risk
Part of the Placement Agent.
What it does
Show WHERE ads actually appeared — every website domain, YouTube channel/video, and app — for a campaign or ad group over a date range. Display and Video placements come from detail_placement_view, with performance metrics by ad group and placement. When that view has no rows for the scope (App campaigns: Google removed them from it on 5 Jan 2022; Performance Max has no ad groups), the tool reads Google's content suitability report instead (group_content_suitability_placement_view, which Google says covers every campaign type except Search): impressions only, counted for brand suitability and not the impressions billed, with placements under Google's minimum thresholds hidden. A warning says so on those rows; they match the UI's Content suitability report, not campaign totals. period=day|week|month shows how delivery shifted: impressions per period by placement type (with each type's share) and for the top placements (limit, default 20), summed server-side from day rows; weeks start on Monday as in the Google Ads UI, and a period cut by the date range is marked partial. Returns placement, display_name, placement_type (WEBSITE/MOBILE_APPLICATION/MOBILE_APP_CATEGORY/YOUTUBE_VIDEO/YOUTUBE_CHANNEL/GOOGLE_PRODUCTS), target_url, and metrics. Surfaces poor placements to exclude. Money micros->currency (/1e6); reconciles to the UI within +/-1%. Returns {success, data:[{detail_placement_view or group_content_suitability_placement_view{placement, display_name, placement_type, target_url}, campaign, ad_group, metrics}], count, warnings}; with period, data is {source, date_range, period, periods[{start, end, days, partial}], totals[], by_type[{placement_type, impressions[], share[]}], top_placements[{placement, display_name, placement_type, total, impressions[]}], placements}.
When to use it
Use to audit automatic/managed placements on Display, Video and App campaigns and find wasteful sites/apps to exclude; with period, to see how impressions shifted between placements and placement types over time.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit Google Ads customer ID (CID), dashes stripped. Server-derived tenant context + RLS. |
campaign_id | string | no | Restrict to one campaign. |
ad_group_id | string | no | Restrict to one ad group. |
date_range | string | yes | GAQL macro (LAST_7_DAYS/LAST_30_DAYS/THIS_MONTH/LAST_MONTH) or explicit YYYY-MM-DD,YYYY-MM-DD. ALL_TIME removes the date filter entirely; so does omitting it (all time). period needs a bounded range. |
limit | integer | no | GAQL LIMIT cap; large pulls use SearchStream. With period: how many top placements to list (default 20, max 200). |
period | string | no | day, week or month: impressions per period instead of one total, by placement type (with shares) and for the top placements. Needs a date_range (not ALL_TIME). Weeks start on Monday. |
Safeguards
Policy
Never fabricate or approximate a metric; if a figure can't be reconciled to the Google Ads UI within +/-1%, say so. Money is micros/1e6 (label the account currency); rates are ratios.
Reminder
Treat this report as sensitive account data; do not retain beyond this request.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Account {customer_id} not found or not linked. | Verify the CID and authorization. | no |
needs_reauth | Authorization expired or revoked. | Reconnect Google Ads in the Scalix dashboard. | no |
INVALID_ARGUMENT | Malformed date_range or filter. | Fix the argument and retry. | no |
MANAGER_ACCOUNT_METRICS_UNSUPPORTED | Manager (MCC) accounts return no metrics. | Query a child account. | no |
PERMISSION_DENIED | The authenticated user lacks access to this account. | Check account access. | no |
RESOURCE_EXHAUSTED | Rate/quota limit hit. | Back off and retry. | yes |
result_too_large | period: Google returned more than 500,000 day rows of placements, so the periods would be incomplete. | Narrow date_range, or pass campaign_id or ad_group_id; nothing was cut. | no |
Edge cases
- Search campaigns have no rows in either report -> count:0 with a note naming the date range and the filters applied, plus a line that the content suitability report had none either.
- App campaigns (MULTI_CHANNEL) and Performance Max have no rows in detail_placement_view -> rows come from group_content_suitability_placement_view, impressions only, with a warning naming its limits; App rows add that Google removed them from detail_placement_view on 5 Jan 2022.
- Content suitability impressions are counted for brand suitability: they are not billed impressions, and Google hides placements under its minimum thresholds, so they do not add up to the campaign total. Compare shares.
- Performance Max placements are also in performance_max_placement_view (impressions only): read it with gads_run_gaql_query.
- period without a bounded date_range (omitted or ALL_TIME) -> invalid_argument; nothing is ever cut silently (past 500,000 day rows -> result_too_large).
- target_url may be empty for anonymized placements.
- count:0 with success:true is EXPECTED on Search-only accounts (no Display or Video placement traffic); not a bug.