Export change history

353 views
Skip to first unread message

Rico Yarde

unread,
Mar 8, 2024, 6:11:21 PM3/8/24
to Google Ads Scripts Forum
I'm looking to create a Google Ads Script that exports the change history log for the last 7 days to a Google Sheet.

This script must be able to run from the MCC level.

Nils Rooijmans

unread,
Sep 2, 2024, 2:49:47 AM9/2/24
to Google Ads Scripts Forum
you can use a GAQL query to get the change history entries using the 'change_event' report.

I've created a script that alerts you when changes by users other than yourself happen in your account. You can use it as an example to create your own version. 

Here it is

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,
Sep 2, 2024, 8:23:15 AM9/2/24
to adwords...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads Scripts support team.

@Nils, Thank you for your input.

You can review the sample code below to export the change history log for the past 7 days to a Google Sheet.
function main() {

  const spreadsheet = SpreadsheetApp.create('Test_report');

  const report = AdsApp.report(
      'SELECT campaign.id, campaign.name, change_event.client_type, change_event.change_resource_type, change_event.change_date_time  ' +
      'FROM  change_event  ' +
      'WHERE change_event.change_date_time DURING LAST_7_DAYS LIMIT 10 ');
  
  report.exportToSheet(spreadsheet.getActiveSheet());
  console.log(spreadsheet.getUrl());

}
Hope this helps! Let us know if you have any further questions. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vFfKR:ref" (ADR-00266057)

Thanks,
 
Google Logo Google Ads Scripts Team


Rishi Kumar

unread,
Oct 4, 2024, 4:57:14 AM10/4/24
to Google Ads Scripts Forum
Hi All,

Is it possible to get the Change history column in the Google sheet using script. I tried, but I'm unable to get the Change column description using Script.

Any one can help? 


change history.jpg

Google Ads Scripts Forum Advisor

unread,
Oct 4, 2024, 9:49:17 AM10/4/24
to adwords...@googlegroups.com

Hi,

Thank you for reaching out to the Google Ads Scripts support team.

I would like to inform you that there is no method available in the Google Ads Scripts to get the change column details in the change history. You can check the changes manually in the UI by navigating to the Change history of the account.

I hope this helps! Kingly get back to us if you still have any concerns. 

Reply all
Reply to author
Forward
0 new messages