google_ads_cpc_detect_trend
Analyze CPC trends in a Google Ads campaign using daily segmentation and linear regression. Returns trend direction, slope, and insights on week-over-week surges and outlier days.
Instructions
Detect rising/falling CPC trends in a Google Ads campaign over a reporting window using daily segmentation and linear regression. Returns {campaign_id, campaign_name, period, data_points, daily_data:[{date, average_cpc, clicks, impressions, cost}], trend:{direction ('rising'|'falling'|'stable'|'insufficient_data'), slope_per_day, change_rate_per_day_pct? (present only when direction is not 'insufficient_data' — i.e. when at least 2 daily data points are available), avg_cpc, min_cpc, max_cpc}, insights:[strings]}. Direction is 'rising' when daily change > +1%, 'falling' when < -1%. Days with zero clicks are excluded from the GAQL. Insights call out week-over-week surges >15% and days exceeding 2x average CPC. Read-only. For device or auction-share investigation use google_ads_device_analyze or google_ads_auction_insights_analyze.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer_id | No | Google Ads customer ID as a 10-digit string without dashes (e.g. '1234567890'). Optional — falls back to GOOGLE_ADS_CUSTOMER_ID / GOOGLE_ADS_LOGIN_CUSTOMER_ID from the configured credentials when omitted. | |
| campaign_id | Yes | Campaign ID as a numeric string without dashes (e.g. '23743184133'). Obtain via google_ads_campaigns_list. | |
| period | No | Reporting window for the metrics. Default 'LAST_30_DAYS'. Use a shorter window (LAST_7_DAYS / LAST_14_DAYS) when diagnosing recent changes; use LAST_90_DAYS for trend baselines. |