Execution Logs
Stay organized with collections
Save and categorize content based on your preferences.
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):
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.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-18 UTC."],[[["Google Ads scripts provide two types of execution logs: Changes logs (tracking entity modifications) and Logs output (displaying script messages)."],["Changes logs detail all alterations made by the script to Google Ads entities, including before and after values, and can be filtered to show only errors."],["Logs output displays messages generated by the script using `console.log`, `console.warn`, and `console.error`, useful for debugging and providing context during live executions."],["Errors and warnings encountered by scripts during execution are automatically included in the text logs for troubleshooting."]]],[]]