gads_get_shopping_performance
Google Ads read low risk
Part of the Shopping Campaign Agent.
What it does
Report Shopping/PMax-retail performance at the product (offer/item) level via GAQL on shopping_performance_view: impressions, clicks, CTR, cost, conversions, conversions_value, ROAS, plus product attributes (item_id, title, brand, product_type, custom_label_n, condition, channel) and benchmark/feed-quality signals where exposed.g., disapproved/out-of-stock). Accuracy: cost is micros (÷1e6); ROAS = conversions_value ÷ (cost_micros/1e6) client-side; aggregating across segments multiplies rows; figures are platform-reported and reconcile to the UI (±1%). Read-only.
When to use it
When the user asks how Shopping/retail products perform — by item, brand, or product type — across Shopping and retail PMax campaigns.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID; strip dashes. |
date_range | string | yes | Macro (LAST_7_DAYS/LAST_30_DAYS) or YYYY-MM-DD..YYYY-MM-DD; prior period auto-derived. DEFAULT: date_range defaults to LAST_30_DAYS when omitted (a warning says so); pass date_range=ALL_TIME to query without a date filter. |
campaign_id | string | no | Restrict to one Shopping/PMax-retail campaign. |
order_by | string | no | Metric to sort by (e.g., metrics.cost_micros DESC, metrics.conversions_value DESC). |
limit | integer | no | Row cap; default 200; tool paginates SearchStream. |
Safeguards
Policy
Read-only; surfaces product performance + disapproval flags. Reconcile to the Google Ads/Merchant UI (±1%); never fabricate product metrics; flag disapproved products for feed correction, not circumvention (Circumventing Systems).
Reminder
Match the UI exactly; convert micros; show prior-period delta; feed/product data only (no user data); account-isolated.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
MANAGER_ACCOUNT_METRICS | Metrics requested on an MCC CID. | Re-issue against a serving child CID. | no |
CUSTOMER_NOT_FOUND | CID invalid/inaccessible. | Verify CID; if revoked set needs_reauth. | no |
TOKEN_REVOKED | Token revoked/expired. | Set needs_reauth; prompt reconnect. | no |
INVALID_ARGUMENT | Bad GAQL / unsupported segment combination / invalid range. | Surface the platform message; correct the query (e.g., incompatible segments). | no |
RESOURCE_EXHAUSTED | Quota/QPS exceeded (HTTP 429). | Backoff 5/10/20s cap 60s, retry once. | yes |
PLATFORM_UNAVAILABLE | Backend 5xx/INTERNAL. | Retry once after backoff. | yes |
Edge cases
- No Shopping/PMax-retail data in range -> success count:0.
- Segment multiplication: brand x product_type rows multiply; don't sum a metric twice across segments.
- Products with impressions but 0 conversions -> include; basis for exclusion/rebid recommendations.
- Disapproved/out-of-stock products may have spend but no serving -> flag for feed fix.
- Large catalogs paginate; advise narrowing by campaign_id/segment or order_by+limit.
- Metrics on MCC blocked -> use child CID.
- count:0 with success:true is EXPECTED on accounts without Shopping/PMax-retail campaigns — a warning explains it; not a bug.