Google Ads script

Account snapshot (30 days)

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.

← All scripts
Read-onlyTry the script in a demo account — see the log, the changes and what it means.
Demo account
Script · Account snapshot
Not run yet
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()
);
}
}
Press Preview to see what the script does in the demo account.

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.

How to run the script
  1. Google Ads → Tools → Bulk actions → Scripts.
  2. Click + and paste the code. Authorize when asked.
  3. Run a preview first and read the log.
  4. Schedule the script if you want it to run regularly.
SEOZ runs these checks for you — automatically, with alerts when something breaks.
Try the guided demo →More scripts