Creating a script to do an automated review on Rejected creatives

100 views
Skip to first unread message

Mehdi Djebbari

unread,
Oct 20, 2020, 10:11:23 AM10/20/20
to Google Ads Scripts Forum

Hi there,
I need your help to create a script (I've never done it before)

I have an issue with my Creatives, which are rejected for no reason twice a day, and it impacts a lot the campaign delivery and results.

The idea is to create a script to do an automated review on Rejected creatives because as you can imagine, I have a lot of accounts and a lot of ads rejected. And it takes a lot of time to do a Manual review.

Does anyone have ever done it before ?

Thanks a lot for your help.

Cheers,
Mehdi

Google Ads Scripts Forum Advisor

unread,
Oct 20, 2020, 10:11:07 PM10/20/20
to adwords...@googlegroups.com

Hi Mehdi,

Thanks for reaching out to us.

In order to automate the process of checking those rejected ads, the easiest way to do this is through Reports. Then, utilize this Ad Performance Report and check on this specific field (CombinedApprovalStatus).

Hope this helps.

Regards,

Google Logo
Mark Kevin Albios
Google Ads Scripts Team
 


ref:_00D1U1174p._5004Q26AgxV:ref

Sigurd Fabrin

unread,
Oct 21, 2020, 9:57:16 AM10/21/20
to Google Ads Scripts Forum
Hi Mehdi,

As Mark says, use reports to get data.

Perhaps you can get inspiration from this simple script that will export a report with disapproved ads to a spreadsheet.
Instead of exporting the report directly, you could consider categorising the various disapproval reasons first - or you can do it in the spreadsheet via formulas afterwards

var settings = {
  
  sheet:'SheetName',
  
}

function main() {
  var campaignIds = [];
  Logger.log('Looking in campaign(s): ')
  var campaignSelector = AdsApp.campaigns()
  .withCondition('Status = "ENABLED"')
  .withCondition('ServingStatus IN ["SERVING"]') // ignore ended campaigns
  .get()
  while (campaignSelector.hasNext()) {
    var campaign = campaignSelector.next();
  campaignIds.push(campaign.getId())
  Logger.log(campaign.getName())
  }
  if (campaignIds.length > 0) {
  var report = AdsApp.report(
    'SELECT ' +
    'ExternalCustomerId,CampaignId,AdGroupId,Id,CampaignName,AdGroupName,CombinedApprovalStatus,PolicySummary,CreativeFinalUrls ' +
    'WHERE CampaignId IN [' + campaignIds.join(',') + '] ' +
    'AND AdGroupStatus = "ENABLED" ' +
    'AND Status = "ENABLED" ' +
    'AND CombinedApprovalStatus = "DISAPPROVED"'
  )
  var ss = SpreadsheetApp.openByUrl(settings.url);
  var sheet = ss.getSheetByName(settings.sheet);
   report.exportToSheet(sheet);
    Logger.log('*\nData exported to this spreadsheet:\n\n..'+settings.url)
  }
  else {Logger.log('Didn\'t find any campaigns matching criteria')}
}

Google Ads Scripts Forum Advisor

unread,
Oct 21, 2020, 9:24:26 PM10/21/20
to adwords...@googlegroups.com

Hi Sigurd,

Thanks for sharing your simple script.

@Mehdi - You may consider Sigurd's sample script. If you have further questions/concerns, let us know and we'll be happy to assists you.

Regards,

Reply all
Reply to author
Forward
0 new messages