گزارش های اجرایی
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
اسکریپتهای Google Ads دو نوع گزارش اجرا را نمایش میدهند، هم در حالت پیشنمایش و هم در اجرای واقعی: گزارشهای تغییرات و خروجی گزارشها.
- گزارش تغییرات
گزارشهای تغییرات، همه تغییرات موجودات Google Ads را که توسط اسکریپت انجام میشوند نشان میدهند: توضیحات موجودیت، نوع تغییر، مقدار قبل و بعد و خطاها (در صورت وجود):

گزارش تغییرات را می توان بیشتر فیلتر کرد تا فقط خطاها را نمایش دهد.
- خروجی لاگ ها
اگر console.log("Hello world!");
در یک فیلمنامه، "سلام دنیا!" در گزارش ها ظاهر می شود. ثبت بیت های متن به ویژه در هنگام اشکال زدایی مفید است، اما اغلب در هنگام اجرای زنده نیز مفید است. فرض کنید اسکریپت زیر قرار است روزانه اجرا شود:
let spreadsheet = SpreadsheetApp.create("Daily Report");
// Populate the spreadsheet.
// ...
console.log("Daily report ready!");
console.log(spreadsheet.getUrl());
در هر اجرا، اسکریپت URL صفحهگسترده جدید ایجاد شده را ثبت میکند و پیدا کردن آن را بعدا آسانتر میکند. همچنین می توانید از console.warn()
یا console.error()
برای ثبت متن نارنجی یا قرمز در گزارش ها استفاده کنید.
علاوه بر پیامهای گزارش مشخص شده توسط برنامهنویس، هرگونه خطا و هشداری که اسکریپت Google Ads در حین اجرا با آن مواجه میشود نیز در گزارشهای متنی ظاهر میشود.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-09-03 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-09-03 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eGoogle Ads scripts provide two types of execution logs: Changes logs (tracking entity modifications) and Logs output (displaying script messages).\u003c/p\u003e\n"],["\u003cp\u003eChanges 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.\u003c/p\u003e\n"],["\u003cp\u003eLogs output displays messages generated by the script using \u003ccode\u003econsole.log\u003c/code\u003e, \u003ccode\u003econsole.warn\u003c/code\u003e, and \u003ccode\u003econsole.error\u003c/code\u003e, useful for debugging and providing context during live executions.\u003c/p\u003e\n"],["\u003cp\u003eErrors and warnings encountered by scripts during execution are automatically included in the text logs for troubleshooting.\u003c/p\u003e\n"]]],[],null,["# Execution Logs\n\nGoogle Ads scripts display two types of execution logs, both in preview mode and in\nreal executions: Changes logs and Logs output.\n\nChanges log\n\n: Changes logs display all changes to Google Ads entities performed by the\n script: entity description, type of change, value before and after, and errors\n (if any):\n\n:\n\n: Changes logs can be further filtered to only display errors.\n\nLogs output\n\n: If you execute `console.log(\"Hello world!\");` in a script, \"Hello\n world!\" appears in the logs. Logging bits of text is particularly useful\n during debugging, but is often helpful during live executions too.\n Suppose the following script is scheduled to run daily:\n\n let spreadsheet = SpreadsheetApp.create(\"Daily Report\");\n // Populate the spreadsheet.\n // ...\n console.log(\"Daily report ready!\");\n console.log(spreadsheet.getUrl());\n\n: In every execution, the script logs the URL of the newly created spreadsheet,\n making it easier to find later. You can also use `console.warn()` or\n `console.error()` for logging orange or red text in the logs.\n\nIn addition to programmer-specified log messages, any\n[errors and warnings](/google-ads/scripts/docs/concepts/errors) the Google Ads scripts\nencounters during execution will also appear in the text logs."]]