Use the following steps to install and configure the Google Ads Anomaly Detection Script in your Google Ads account and link it to a Google Spreadsheet.
-
Create a new Google Spreadsheet in your Google Drive (or pick an existing one).
-
Rename the spreadsheet to something meaningful, e.g. “Ads Anomaly Detection.”
-
Create (or confirm existence of) the following sheets inside this spreadsheet:
-
Config
-
Row 1 could have headers, but the script reads data starting from row 2.
-
Below is an example of how you might structure it:
Key Value CTR_DROP 0.20 IMPRESSIONS_DROP 0.25 CONVERSION_RATE_DROP 0.30 SPEND_CHANGE 0.50 NO_SPEND_DAYS 3 LOW_IMPRESSION_SHARE 40 HIGH_BID_LIMIT 2.50 LOW_QUALITY_SCORE 5 FIRST_PAGE_BID_RATIO 0.80 LOW_DEVICE_PERFORMANCE 0.30 MAX_EXECUTION_TIME 10 LOW_SEARCH_VOLUME 50 LOOKBACK_DAYS 7 MAX_TOTAL_ANOMALIES 1000 EMAIL_RECIPIENT your.email@example.com -
Feel free to adjust the thresholds and add other config values as needed.
-
-
Exclusions
-
Row 1 could have headers, but the script reads from row 2 onward.
-
Example layout:
EntityType NameOfEntity campaign Brand - Exact adGroup Branded Competitor Ads keyword free -
This allows you to exclude specific campaigns, ad groups, or keywords from checks.
-
-
Log (optional)
- The script will write logs into a sheet named
Logautomatically.
- The script will write logs into a sheet named
-
Historical Data (optional)
- The script has helper functions to store data. If you want to enable that, create a
Historical Datasheet. The script will manage rows and columns dynamically.
- The script has helper functions to store data. If you want to enable that, create a
-
Any other (the script automatically creates other named sheets like
Impression Anomalies,Click Anomalies, etc.).
-
-
Copy the Spreadsheet URL (from your browser’s address bar) and note it for use in the script configuration variable
SPREADSHEET_URL.
-
Log in to your Google Ads account.
-
Navigate to Tools & Settings (top menu) → Bulk Actions → Scripts.
-
Click the “+” button (blue plus icon) to create a new script.
-
Give your script a name, e.g. Google Ads Anomaly Detection.
-
Copy and paste the entire script (from your local file or this GitHub repository) into the Google Ads Script Editor.
-
Set the
SPREADSHEET_URLat the top of the script to reference your newly created Google Spreadsheet link.var SPREADSHEET_URL = 'https://docs.google.com/spreadsheets/d/<YOUR_SPREADSHEET_ID_HERE>';