Read-only. Logs 30-day performance per active campaign — impressions, clicks, cost and conversions, sorted by cost. A quick health check without opening the UI.
function main() { // Read-only: logs 30-day performance for each enabled campaign. var campaigns = AdsApp.campaigns() .withCondition('Status = ENABLED') .forDateRange('LAST_30_DAYS') .orderBy('Cost DESC') .get(); Logger.log('Campaign | Impr | Clicks | Cost | Conv'); while (campaigns.hasNext()) { var c = campaigns.next(); var s = c.getStatsFor('LAST_30_DAYS'); Logger.log( c.getName() + ' | ' + s.getImpressions() + ' | ' + s.getClicks() + ' | ' + s.getCost().toFixed(2) + ' | ' + s.getConversions() ); }}Simulated run in a fictional demo account. The script’s real code runs in your browser against sample data — nothing connects to Google Ads, no emails are sent and no sheets are created.