get_impact_analysis
Run Adlyse’s recent-impact analysis for one ad account: week-over-week metric shifts correlated with logged decisions and change events. This is the same computation that populates the dashboard’s “Recent Impact” card.
Parameters#
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
ad_account_id | string | yes | Ad account id | |
lookback_days | integer | no | 7 | Window size in days for current and prior period (clamped 1–90) |
Returns#
json
{
"ad_account_id": "ad_acct_abc123",
"lookback_days": 7,
"impact": {
"summary": "Conversions up 12% week-over-week driven by Campaign Alpha",
"conversion_delta_pct": 12.3,
"cpa_delta_pct": -5.7,
"top_campaign_gains": [ ],
"top_campaign_drops": [ ],
"correlated_events": [ ]
},
"as_of": "2026-04-22",
"source": "adlyse.impact_analysis@v1"
}The impact object shape depends on the data available. When there’s insufficient data, it returns { "summary": "Insufficient data for impact analysis" } rather than an error.
| Field | Description |
|---|---|
impact.summary | Short natural-language headline |
impact.conversion_delta_pct | Percentage change in total conversions vs. the prior window |
impact.cpa_delta_pct | CPA change; negative = improvement |
impact.top_campaign_gains | Up to 3 campaigns with the largest conversion lift |
impact.top_campaign_drops | Up to 3 campaigns with the largest conversion drop |
impact.correlated_events | Decision-log entries and change events inside the window, attributed |
as_of | The date the analysis was run against (today) |
Errors#
error_type | When |
|---|---|
auth_error | Missing / invalid API key |
not_found | Ad account doesn’t belong to your org |
computation_error | Underlying service raised (e.g. missing metric table) |
Example#
Request:
json
{
"ad_account_id": "ad_acct_abc123",
"lookback_days": 14
}Response (excerpt):
json
{
"ad_account_id": "ad_acct_abc123",
"lookback_days": 14,
"impact": {
"summary": "Conversions up 8% over the last 14 days; CPA improved 6%",
"conversion_delta_pct": 8.1,
"cpa_delta_pct": -6.3
},
"as_of": "2026-04-22",
"source": "adlyse.impact_analysis@v1"
}See also#
get_dashboard_snapshot— the snapshot’srecent_impactfield contains the same structure