Remove a campaign or ad group methods?

28 views
Skip to first unread message

James Pell

unread,
Feb 7, 2020, 10:40:06 AM2/7/20
to Google Ads Scripts Forum
Hi,

Is it possible to remove/delete a campaign or ad group? I can see a pause method in the docs but no remove method.

Google Ads Scripts Forum Advisor

unread,
Feb 7, 2020, 2:36:00 PM2/7/20
to adwords-scripts+apn2wqf9yrp-5zuw...@googlegroups.com, adwords-scripts+apn2wqf9yrp-5zuw...@googlegroups.co, adwords...@googlegroups.com
Hi James,

The only way to remove ad groups or campaigns in scripts is through bulk uploads. Please see this useful code snippet on updating campaigns (it can easily be adapted for ad groups -- see supported entities and columns here). For example, the code below will remove a campaign called 'Test Campaign'.

function main() {  
 
  var columns = [
    'Campaign', 'Action'  //Campaign Name and Action (remove)
  ];

  var upload = AdsApp.bulkUploads().newCsvUpload(
      columns, {moneyInMicros: false});
  upload.append({
    'Campaign': 'Search Campaign',
    'Action': 'remove'
  });
  upload.preview();  
}

To remove many entities, I recommend using Sheets (please see this snippet).

Regards,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5001UV09ek:ref

James Pell

unread,
Feb 11, 2020, 3:48:22 AM2/11/20
to Google Ads Scripts Forum
Thanks, that's really helpful
Reply all
Reply to author
Forward
0 new messages