PMax Trending Search Categories
Reports which search categories are trending up or down in your Performance Max campaigns — last 7 days vs the 7 days before — using campaign search term insights.
by Nils Rooijmans·nilsrooijmans.com/google-ads-script-pmax-trending-search-categories
Overview
PMax hides its search terms, but Google does expose aggregated 'search category' insights. This script queries campaign_search_term_insight for every enabled PMax campaign, compares category impressions for the last 7 days against the 7 days before, and writes the trending categories (with absolute and relative change) to a Google Sheet plus an optional email — early warning for demand shifts inside the PMax black box.
Setup
- 1Create a new blank Google Sheet and copy its URL.
- 2Open your Google Ads account and go to Tools → Bulk Actions → Scripts.
- 3Click the + button to create a new script and paste the code below.
- 4Set SPREADSHEET_URL and EMAIL_ADDRESSES, preview, then schedule weekly.
Configuration Variables
| Variable | Default |
|---|---|
SPREADSHEET_URL | (required) |
EMAIL_ADDRESSES | (required) |
IMPRESSIONS_MIN_ABS_DIFFERENCE | 100 |
IMPRESSIONS_MIN_REL_DIFFERENCE | 0.5 |
SEND_EMAIL |
Expected Output
Sheet rows per trending category: campaign, search category, impressions last 7 days, impressions previous 7 days, absolute and relative difference.
Notes
Search term insights are aggregated categories, not raw queries — Google exposes nothing finer for PMax. The insight resource only holds recent data, so weekly scheduling keeps a continuous trail. A high-performance MCC version is available from the author.