What Is It?
The Anomaly Detector script lets you set an alert for scenarios where an account's key metrics deviates from the expected performance levels, for a given day of the week and hour of the day. It lets you see the status of all your accounts in a single spreadsheet and serves as a mini dashboard.
This enhanced script is an adaptation of Google's Anomaly Detection script and works at the MCC account level. The script aggregates all settings and outputs in a single Google Sheet and adds a color-coded dashboard to complement email notifications.
Why Use It?
Stay on top of key metrics without manually monitoring accounts throughout the day.
Get alerts tailored to your business priorities with customizable sensitivity thresholds.
Reduce wasted spend by identifying unusual spikes in cost or drops in performance early.
Monitor multiple accounts in one place with a centralized, easy-to-read dashboard.
Make faster, data-driven decisions with hourly performance comparisons against historical trends.
Basic Settings
Google Spreadsheet Settings
The script outputs the results onto a Google Spreadsheet. There are two options for this, you can:
Paste the results into an existing spreadsheet. For this, you'll need to detail the address of the spreadsheet. The sharing settings for the spreadsheet should be 'anyone with a link'.
Please note that if the sharing settings are not correct, the script will not be able to write the URLs it checks, onto the spreadsheet. You’ll also set a name under “name of target sheet” that’ll be the one used to create a new sheet if the one you’ve selected isn’t already present.
Create a new spreadsheet each time the script runs. For this, simply leave "NEW", in the text field. Under the “name of target sheet” you’ll define which name to use for the new spreadsheet.
How it works
The script checks if all the required columns and rows are present, based on the given sheet name and the current Account ID the script is executing for. If the script can’t find them, it’ll create a new row with the Account ID and the required missing columns.
The way it works is it’ll first pull in data for the day the script is run, and then for each day of the past weeks chosen. For example, if the script is run on Thursday with past weeks as 4, the data pulled will be for every Thursday of the last 4 weeks. It does this up until the current hour it is running at, minus the offset hours defined, to avoid reporting delays.
Notification and Sharing Settings
Share Results Spreadsheet With These Google Accounts: Enter additional email addresses you want to share the spreadsheet with. Use a comma-separated list for multiple email addresses.
Sensitivity of Alerts: You can set the sensitivity of alerts for different metrics by defining a threshold for metrics like Impression, Clicks, Cost, and Conversions. Threshold means the percentage by which today's values may differ from the expected averages before triggering an anomaly alert.
For example, 0.20 means an anomaly is triggered if there is more than a 20 percent difference, either higher or lower. Select 0 if you do not want to be alerted about this metric.
Advanced Settings
How to Calculate the Baseline of What is Expected: The number of weeks used to calculate the average expected performance.
When to Get Alerts: If it is left blank, the script will run for every hour. However, if you are looking to run the script for only certain hours, you’ll need to mention them here under comma-separated values. In this case, the script will compare the current hour to the hours mentioned, and if it matches, the script will run.
Note: The hours defined in Optmyzr settings can only match and work while the script is running in Google Ads. It won’t supersede the automation frequency of the script configured in Google Ads.
How to handle Google Reporting Delays: Google reports are not real-time, so the data from the last three hours may not be included in the reports we use to check for anomalies. Use this setting to specify how many hours we should delay checking. For example, if you choose 3 here, then at 10.00 am we will check stats through 7:00 am.
Log Settings
Show Debug Data In Logs: Select this option to get a complete list of logs that can be useful when reporting a problem to Optmyzr. This option can decrease the performance of scripts so it is recommended to be turned off if not necessarily needed.
Show Verbose Output In Logs: Select this option to see how the script operates. This option helps understand how the script works. It may, however, slow down the performance so it is recommended to be used only for the first time you want to check if all the settings are in place.
Does the name of the Target Sheet (in the child account settings in Optmyzr) have to be the same as the name of the Spreadsheet it reports to?
The target sheet name must match exactly the name of the tab. If it can't find a match, it will make a new tab.
Does the e-mail alert send out notifications every hour for each metric checked?
The system will continue to send emails about an alert every hour even if it's the same alert that happened last hour. We recommend getting one alert per day and use the settings for 'hours to check' to ensure you don't get emails before some reasonable time of the morning when there should be some significant stats.
Are the alerts for each metric independent from one another?
We send at most one email per hour that includes all alerts together in 1 email.
Use Cases
Monitor Sudden Drops in Conversions
Problem: You notice a dip in conversions, but by the time you identify it manually, you’ve already lost valuable leads and revenue. Constant monitoring across accounts is time-consuming and prone to delays.
Solution: The Anomaly Detector script automatically tracks your conversion data against historical performance for the same day and hour. It alerts you as soon as conversions drop beyond your defined threshold, allowing you to investigate and take corrective action immediately.
Manage Multiple Accounts from a Single Dashboard
Problem: When managing multiple accounts under an MCC, it becomes difficult to track performance across all accounts without switching between dashboards.
Solution: The script consolidates all account-level data into a single Google Spreadsheet, creating a centralized, color-coded dashboard. You can instantly view the status of all accounts and identify anomalies without navigating multiple interfaces.



