Sitelinks Approval Status Script

384 views
Skip to first unread message

Amir Scapa

unread,
Jan 30, 2017, 11:47:40 AM1/30/17
to AdWords Scripts Forum
Hi there,

I'm trying to write a script to alert me for every sitelink that are disapproved (since I don’t get those kinds of notification by email).

I start writing the following script and got an error “TypeError: Cannot find function withCondition in object [Extensions]. (line 7)”
I looked at AdWords scripts reference and couldn’t find the “ApprovalStatus” column under “AdWordsApp.SitelinkSelector – withCondition”. Is it possible that AdWords Script doesn’t support approval status for ad extensions?

//-----------------------------------

// Sitelink's Disapproved Alert

// Created By: Amir

//-----------------------------------

function main() {

  // Let's start by getting all of the sitelinks that are disapproved

  var sitelinkIterator = AdWordsApp.extensions()

  .withCondition("ApprovalStatus != APPROVED")

  .get();

 

  // Then we will go through each one

  while (sitelinkIterator.hasNext()) {

      var sitelink = sitelinkIterator.next();

    // now we print a log and send an alert email

    Logger.log("sitelink disapproved: " + sitelink.getLinkText());

  }

}



Thanks in advance!

Trevor

unread,
Jan 30, 2017, 11:57:20 AM1/30/17
to AdWords Scripts Forum
Hi Amir,

Two problems that I notice

1. Your selector is missing .sitelinks() after .extensions(), like this:

  var sitelinkIterator = AdWordsApp.extensions()
 
.sitelinks()

 .withCondition("ApprovalStatus != APPROVED")

 .get();



2. ApprovalStatus does not appear to be a valid column available to withCondition for the sitelink selector: https://developers.google.com/adwords/scripts/docs/reference/adwordsapp/adwordsapp_sitelinkselector#withCondition_1

You could potentially have it look for sitelinks that haven't received any impressions over a certain time period and make the assumption that those are either disapproved or worth looking into, but unfortunately it doesn't appear that ApprovalStatus is available directly.

Anthony Madrigal

unread,
Jan 30, 2017, 12:16:04 PM1/30/17
to AdWords Scripts Forum
Hi Amir,

Thanks for the input Trevor.

Although ApprovalStatus is not a valid filter for sitelinks, you can filter using DisapprovalShortNames as such after adding Trevor's suggestion to add .sitelinks()
.withCondition("DisapprovalShortNames != ''")

As a reference, you can filter any of the fields listed here that have Filterable = True. Please let me know if you are still experiencing issues.

Cheers,
Anthony
AdWords Scripts Team

Trevor

unread,
Jan 30, 2017, 12:50:22 PM1/30/17
to AdWords Scripts Forum
Hi Anthony,

Is there any sort of reference document that links selectors with their corresponding reports?

Thank you!

Anthony Madrigal

unread,
Jan 30, 2017, 1:52:16 PM1/30/17
to AdWords Scripts Forum
Hi,

We are currently working on making the documentation more consistent with their pages. However, you can use the reports corresponding to the entities based on their names. For example, the Campaign Performance Report can be used for campaign selectors and the Ad Group Performance Report can be used to select ad groups and so on.

Amir Scapa

unread,
Jan 31, 2017, 6:23:45 AM1/31/17
to AdWords Scripts Forum
Hi Anthony and Trevor,

I add the sitelinks selector and replace the withCondition with the DisapprovalShortNames filter. This worked like a charm, and I got a log with all off my disapproved sitelinks. Now I won't miss any sitelinks that were disapproved for any reason.

Thanks a bunch!

Amir 

Nikolai Wiskow

unread,
Jun 17, 2020, 11:24:11 AM6/17/20
to Google Ads Scripts Forum
Hi,

are there known cases where the .withCondition("DisapprovalShortNames != ''") won't work?

I have an account with 42 Sitelinks disapproved. But when I filter via the above filter, I get no elements. They don't appear in the FeedItemPlaceholderReport either.

Without the filter, they are correctly returned by the selector. Even the positive filter works .withCondition("DisapprovalShortNames = ''") in a way that it will only show the non-disapproved sitelinks. But then when I switch the filter query to the != operator, I just get 0 results.

Anybody have an idea what's up with that?

Thanks,
Nikolai

Google Ads Scripts Forum Advisor

unread,
Jun 17, 2020, 3:24:14 PM6/17/20
to adwords-scripts+apn2wqes1r67p-mc...@googlegroups.com, adwords-scripts+apn2wqes1r67p-mc...@googlegroups.co, adwords...@googlegroups.com
Hi Nikolai,

Can you please provide your CID and an example of a disapproved sitelink that is not captured by the script?

Thanks,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5004Q217CgA:ref

Nikolai Wiskow

unread,
Jul 9, 2020, 8:15:51 AM7/9/20
to Google Ads Scripts Forum
Hi Matt,

did you receive my private message? Iser there any update on this?

Thanks,
Nikolai

Google Ads Scripts Forum Advisor

unread,
Jul 9, 2020, 11:55:19 AM7/9/20
to adwords-scripts+apn2wqes1r67p-mc...@googlegroups.com, adwords-scripts+apn2wqes1r67p-mc...@googlegroups.co, adwords...@googlegroups.com
Hi Nikol,

We did not receive your private reply. Can you please try replying privately one more time, and let us know here on the forum when you send the private reply?

Lyubomir Popov

unread,
Jul 10, 2020, 2:08:38 AM7/10/20
to Google Ads Scripts Forum
Please wait for 6 months .. and then ask again :) :) https://groups.google.com/forum/#!topic/adwords-scripts/5yUUEBstk8E

Google Ads Scripts Forum Advisor

unread,
Jul 10, 2020, 3:34:17 AM7/10/20
to adwords...@googlegroups.com
Hi Lyubomir,

Our team is working with the fix for the issue that has mentioned on that forum thread. Rest assured that will provide update about the issue on that forum thread once available.

Regards,
Ejay
Reply all
Reply to author
Forward
0 new messages