Export Google Ads script results to Google Sheet

447 views
Skip to first unread message

Thorsten Wissowski

unread,
Aug 17, 2023, 7:52:39 AM8/17/23
to Google Ads Scripts Forum
Hi there,

how can I export the script results to google sheet?
I try it with a empty list, i try it with a google sheet draft from the upload page, but my google sheet is still empty.

This are my files I want to export. Keyword, Cost and Conversion

Hope you can help me. :)


3.png

Nils Rooijmans

unread,
Aug 17, 2023, 12:09:57 PM8/17/23
to Google Ads Scripts Forum
there are multiple ways to do this.
One would be to create a GAQL query to get the data you want, and then use this function to export the result to a Google sheet:

// this function sends the output of the GAQL query to a spreadsheet, takes GAQL query and sheet as input parameters

function gaqlToReportSheet(gaqlQuery, sheet) {

  var report = AdsApp.report(gaqlQuery);
 
  report.exportToSheet(sheet);
}


Another way would be to get your data via iterators and the stats object, store it in an array and then add the data from the array to a google sheet.

See my blogpost for instructions:

Hope this helps,

Nils Rooijmans
https://nilsrooijmans.com
See my Google Ads Scripts FAQ to avoid the same mistakes I made: https://nilsrooijmans.com/google-ads-scripts-faq/

Google Ads Scripts Forum Advisor

unread,
Aug 17, 2023, 1:45:31 PM8/17/23
to adwords...@googlegroups.com
Hello,

Thank you for reaching out to us. In order for us to check your concern further, could you kindly share the following?
  • CID
  • Script name 
This message is in relation to case "ref:_00D1U1174p._5004Q2ntMlc:ref"

Thanks,
 
Google Logo Google Ads Scripts Team


Reply all
Reply to author
Forward
0 new messages