Link Checker Single Account: Only check enabled campaigns and enabled ad groups

267 views
Skip to first unread message

Aldric Kurt Ang

unread,
Aug 29, 2023, 10:53:22 PM8/29/23
to Google Ads Scripts Forum
Hello! How do I edit the link checker script so that it only checks links within campaigns, ad groups, and ads that are enabled? I see a lot of instances where it is including broken links inside campaigns that have already ended. Thank you!

Google Ads Scripts Forum Advisor

unread,
Aug 30, 2023, 4:34:38 AM8/30/23
to adwords...@googlegroups.com

Hi Aldric,

 

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

 

The Link Checker solution script's function iterates through all of your ads, keywords, and sitelinks. The template spreadsheet of the Link Checker solution script can be configured in order to include or not include paused ads, keywords or sitelinks and this can be found under the Scope column. You may then set this to No so that only ENABLED ads, keywords and sitelinks are only retrieved.

 

Let me know if you have any questions.
 

This message is in relation to case "ref:_00D1U1174p._5004Q2o9MGg:ref"

Thanks,
 
Google Logo Google Ads Scripts Team


Aldric Kurt Ang

unread,
Aug 30, 2023, 5:06:41 AM8/30/23
to Google Ads Scripts Forum
Hi Scripts team, thanks for the quick reply! 

I have configured the settings already in the spreadsheet. However, I would also like to add additional conditions where the script will only check ads that are within enabled campaigns and enabled ad groups. The reason I want to add these additional conditions is because there are instances where we have broken links within enabled ads that are inside campaigns that have ended. This is why I want the script to skip checking paused and ended campaigns and ad groups. Unfortunately, this is not a setting present in the spreadsheet. 

For reference, here is an old forum post I found with this same question: Link Checker - Only check URLs for enabled ads in active campaigns and active ad groups (google.com). Unfortunately, this is from more than 8 years ago and the code is quite outdated. Could you share how to implement this in the most recent version of the Link Checker - Single Account script? Thank you very much!


Regards,
Aldric

Google Ads Scripts Forum Advisor

unread,
Aug 30, 2023, 10:02:51 AM8/30/23
to adwords...@googlegroups.com
Hi Aldric,

Thank you for responding back. For your use case, you will need to change the following:
  • update all conditions.push(`campaign.status IN ('ENABLED', 'PAUSED')`); to conditions.push(`campaign.status IN ('ENABLED')`);
  • update all conditions.push(`ad_group.status IN ('ENABLED', 'PAUSED')`); to conditions.push(`ad_group.status IN ('ENABLED')`);

Aldric Kurt Ang

unread,
Aug 31, 2023, 3:04:09 AM8/31/23
to Google Ads Scripts Forum
Hi Google Scripts team,

Thanks again for the response. I want to clarify though: since there's already an if.....else statement here in the script (see below), it looks like it's not necessary for me to make this change. From my understanding, if I configure the spreadsheet to not include paused ads, it should already follow this logic. My main concern though is that even though I have configured the spreadsheet to skip checking paused campaigns, it's still checking ads within 'Ended' campaigns (campaigns with status: 'Ended', it looks like most of these 'Ended' campaigns were tests that were completed already). Unfortunately, the script still considers these campaigns as enabled campaigns (Please see the attached image below). Is there a way to exclude these ended campaigns?


Let me know also if you would like me to provide my Googe Ads Account ID privately. Thanks!

 
if (checkPaused) {
    conditions
.push(`ad_group_ad.status IN ('ENABLED', 'PAUSED')`);

    conditions
.push(`campaign.status IN ('ENABLED', 'PAUSED')`);

    conditions
.push(`ad_group.status IN ('ENABLED', 'PAUSED')`);

 
} else {
    conditions
.push(`ad_group_ad.status = 'ENABLED'`);
    conditions
.push(`campaign.status = 'ENABLED'`);
    conditions
.push(`ad_group.status = 'ENABLED'`);
 
}
 


Regards,
Aldric
Sample Campaigns.png
Reply all
Reply to author
Forward
0 new messages