Execution Logs

Google Ads scripts display two types of execution logs, both in preview mode and in real executions: Changes logs and Logs output.

Changes log

Changes logs display all changes to Google Ads entities performed by the script: entity description, type of change, value before and after, and errors (if any):

screenshot of preview screen

Changes logs can be further filtered to only display errors.

Logs output

If you execute console.log("Hello world!"); in a script, "Hello world!" appears in the logs. Logging bits of text is particularly useful during debugging, but is often helpful during live executions too. Suppose the following script is scheduled to run daily:

let spreadsheet = SpreadsheetApp.create("Daily Report");
// Populate the spreadsheet.
// ...
console.log("Daily report ready!");
console.log(spreadsheet.getUrl());

In every execution, the script logs the URL of the newly created spreadsheet, making it easier to find later. You can also use console.warn() or console.error() for logging orange or red text in the logs.

In addition to programmer-specified log messages, errors and warnings encountered by Google Ads scripts during execution will also appear in the text logs.