SCALIX help

← All tools

gads_get_campaign

Google Ads read low risk

Part of the Google Ads Manager Agent.

What it does

Fetches a single campaign's full configuration and (optionally) headline metrics via GAQL on the campaign resource. Returns campaign.id, name, status, advertising_channel_type/sub_type, bidding strategy + targets, campaign_budget.amount_micros, start/end dates, serving_status, and (when a date range is given) impressions/clicks/CTR/average_cpc/cost_micros/conversions/conversions_value. Accuracy: cost/bid fields are micros — divide by 1e6 before display and label currency; CTR/conv-rate are format-appropriate ratios; if a date range is supplied, include the prior_period deltas via include_prior_period=true. Numbers must reconcile to the Google Ads UI within ±1%. Read-only; returns {success:true,data:{...campaign...},count:1,warnings} or success with count:0 if not found, or the standard error envelope.

When to use it

When the user asks about ONE specific campaign — its settings, status, bidding, budget, or metrics. For the account-wide campaign list use gads_list_campaigns.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped.
campaign_idstringyesNumeric campaign ID (or full campaign resource_name).
include_metricsbooleannoIf true, also select metrics.* for the date_range (segment-free totals).
date_rangestringnoGAQL date macro (LAST_7_DAYS, LAST_30_DAYS, THIS_MONTH, LAST_MONTH) or explicit 'YYYY-MM-DD,YYYY-MM-DD'. Required if include_metrics.
include_prior_periodbooleannoOpt-in: also run the equal-length preceding window and attach prior_period={date_range, metrics, delta_pct} to every row. Needs a translatable date_range (LAST_7/14/30_DAYS, TODAY, YESTERDAY, THIS_MONTH, LAST_MONTH, or explicit 'YYYY-MM-DD,YYYY-MM-DD'); untranslatable ranges skip with a warning.

Safeguards

Policy

Read-only reporting: figures must reconcile to the Google Ads UI within ±1% and never be fabricated or approximated; this tool exposes only what Google returns for the caller's authorized account.

Reminder

Match the Google Ads UI exactly; never fabricate a metric; do not retain account data beyond this request.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDCustomer ID not found / not accessible.Verify CID and access; prompt re-auth if needed.no
TOKEN_REVOKEDOAuth token invalid/revoked (401 UNAUTHENTICATED).Refresh token; if still failing set needs_reauth.no
MANAGER_ACCOUNT_METRICS_NOT_SUPPORTEDMetrics cannot be queried directly on a manager (MCC) account.Query the child operating account instead, or fetch config-only (no metrics) on the MCC.no
INVALID_ARGUMENTGAQL/date-range invalid or campaign_id malformed.Surface the platform message; fix the id/date range and retry.no
PERMISSION_DENIEDOut-of-bearer-scope or missing read access (403).Confirm adwords scope + account access.no
RESOURCE_EXHAUSTEDRate/quota exceeded (429).Backoff 5->10->20s cap 60s, honor retryDelay, retry once.yes
PLATFORM_UNAVAILABLEGoogle Ads API 5xx/INTERNAL.Retry once with backoff; otherwise report the outage.yes

Edge cases

  • Campaign not found / no rows -> success:true, count:0 (not an error).
  • include_metrics=true without a date_range -> require date_range rather than guessing a default.
  • Metrics on an MCC are unsupported -> map to MANAGER_ACCOUNT_METRICS_NOT_SUPPORTED.
  • If segments are added the row count multiplies (one row per segment) — summing is correct only without segments; this tool returns segment-free totals unless asked.
  • A REMOVED campaign still returns config and historical metrics but shows zero spend after its removal date — note the status so deltas aren't misread.
  • Cost/bid micros must be ÷1e6 before display.
  • compare_prior_period uses an equal-length immediately-preceding window.
  • Expired token mid-call -> refresh once and retry.