MCC Link Checker (For only enabled campaigns)

356 views
Skip to first unread message

Leanne Chisnall

unread,
Nov 12, 2015, 8:45:40 PM11/12/15
to AdWords Scripts Forum
Hi there,

I am using the Google AdWords 'MCC Link Checker' Script... However, I am getting a lot of links with 404 errors from campaigns that are no longer active. Is there anyway to just check links in currently enabled campaigns, ads, etc?

Thanks,
Leanne

Tyler Sidell (AdWords Scripts Team)

unread,
Nov 13, 2015, 10:02:47 AM11/13/15
to AdWords Scripts Forum
Hi Leanne,

In order to only check ENABLED campaigns please make the following changes to your script:

Change:
var ads = AdWordsApp.ads()
.withCondition("CreativeFinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.adsLabel + "']")
.get();

To:
var ads = AdWordsApp.ads()
.withCondition("CreativeFinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.adsLabel + "']")
.withCondition("CampaignStatus = ENABLED")
.get();

Also change:
var keywords = AdWordsApp.keywords()
.withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel +
"']")
.get();

To:
var keywords = AdWordsApp.keywords()
.withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
.withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel +
"']")
.withCondition("CampaignStatus = ENABLED")
.get();

Thanks,
Tyler Sidell
AdWords Scripts Team
Message has been deleted

Leanne Chisnall

unread,
Nov 15, 2015, 6:02:04 PM11/15/15
to AdWords Scripts Forum
HI there,

Thanks! I have changed these, but am still getting campaigns that are paused... Is this because they were picked up when I previously ran the script? Do I need to create a new spreadsheet?

Just another question - once the script finishes, is it meant to leave the labels on the keyword, ads, etc? I find this a bit annoying. 

Thanks,
Leanne

AussieWeb Conversion

unread,
Nov 15, 2015, 9:36:33 PM11/15/15
to AdWords Scripts Forum
Hi Leanne

That should definitely only be returning enabled Campaigns now. Are you sure it's the Campaign that's paused rather than the AdGroup or the Ads themselves?
There's another couple of levels for the .withConditions() that I use to make sure it only checks ads that are currently running.

    //For Ad Level Urls
   
AdWordsApp.ads()

      .withCondition("LabelNames CONTAINS_NONE['" + settings.adsLabel + "']")
      .withCondition("Status = 'ENABLED'")
     
.withCondition("AdGroupStatus = 'ENABLED'")
 
    .withCondition("CampaignStatus = 'ENABLED'")
     
.get(),
   
//For Keyword Level Urls

   
AdWordsApp.keywords()
      .withCondition("FinalUrls STARTS_WITH_IGNORE_CASE 'h'")
      .withCondition("LabelNames CONTAINS_NONE['" + settings.keywordsLabel + "']")
      .withCondition("Status = 'ENABLED'")
     
.withCondition("AdGroupStatus = 'ENABLED'")
      .withCondition("CampaignStatus = 'ENABLED'")
     
.get()


Please see if that helps.

Regards
Nigel

Leanne Chisnall

unread,
Nov 15, 2015, 9:40:47 PM11/15/15
to AdWords Scripts Forum
Hi Nigel,

Yes that is how I have it set up. I just realised that 'Ended' campaigns count as 'enabled' campaigns and that was were my issue actually was. 

Thanks for your help. 

AussieWeb Conversion

unread,
Nov 15, 2015, 10:19:46 PM11/15/15
to AdWords Scripts Forum
Hi Leanne

I've hit that issue before too.  You may be able to use this code to skip the 'Ended' campaigns whilst in your loop,
though it'll probably need some slight modification as I've not tested it.
// Check if the campaign has ended and ignore if it has
var endDate = entity.getCampaign().getEndDate();
if(endDate != null && TODAY.year > endDate.year && TODAY.month > endDate.month && TODAY.day > endDate.day) { continue; }


where TODAY is declared globally to be
var TODAY = (function () {  // Needed so as to check for campaigns that have ended and thus to be ignored.
var d = new Date();
return { year: d.getFullYear(), month: d.getMonth() + 1, day: d.getDate()}
})();


I'd love to give credit to the person who gave me this solution, but I can't remember now.

Regards
Nigel

Tyler Sidell (AdWords Scripts Team)

unread,
Nov 16, 2015, 9:30:28 AM11/16/15
to AdWords Scripts Forum
@Nigel, thank you for providing that solution.  

@Leanne, let us know if you have any further questions.

Thanks,
Tyler Sidell
AdWords Scripts Team

Leanne Chisnall

unread,
Nov 16, 2015, 2:36:59 PM11/16/15
to AdWords Scripts Forum
Thanks for all your help Nigel and Tyler - much appreciated. 

Valentin Verger

unread,
Dec 10, 2015, 2:57:50 AM12/10/15
to AdWords Scripts Forum
Hi all,

@Tyler, with your lines, the script does not work :(
It crawls nothing...


Someone can help me ? 
I would like to crawl only enables elements.

Sander

unread,
Dec 10, 2015, 10:47:23 AM12/10/15
to AdWords Scripts Forum
Hi Nigel,

I could be wrong but aren't campaigns that ended earleir this year etc ignored now as well?

I would say:

// Check if the campaign has ended and ignore if it has
var endDate = entity.getCampaign().getEndDate();
if(endDate != null && TODAY.year > endDate.year) { continue; }
else if (endDate != null && TODAY.year == endDate.year && TODAY.month > endDate.month) { continue }
else if (endDate != null && TODAY.year == endDate.year && TODAY.month == endDate.month && TODAY.day > endDate.day) { continue; }

If I'm wrong I'd love to know why:)

Thx
Sander

(probably can make that shorter but for the idea)

Tyler Sidell (AdWords Scripts Team)

unread,
Dec 10, 2015, 10:53:49 AM12/10/15
to AdWords Scripts Forum
Hi Valentin,

In order to get more context, when you say that nothing gets crawled are you referring to the fact that the spreadsheet is empty?  Please provide your CID (reply privately to the author), along with the name of your script, and more information about the issue that you are facing so that we can take a look.

Thanks,
Tyler Sidell
AdWords Scripts Team

Message has been deleted

AussieWeb Conversion

unread,
Dec 10, 2015, 9:40:52 PM12/10/15
to AdWords Scripts Forum

Jordan McClements

unread,
Jan 28, 2016, 5:11:41 AM1/28/16
to AdWords Scripts Forum
Thanks for the great script.

But along the same lines of what Leanne asked for and to cater for those fo use who arem't great coders, would it be possible in the next version of the MCC Link Checker to give the option on the link checker spreadsheet to toggle whether to check anything that is paused or ended. I think the majority of people would find "do not check paused keywords, do not check paused ads, do not check paused ad groups, do not check paused campaigns, do not check ended campaigns" settings very useful.

Thanks.

Jordan McClements

unread,
Jan 28, 2016, 5:14:25 AM1/28/16
to AdWords Scripts Forum
I'm using version 1.3 of the MCC Link Checker by the way.

Tyler Sidell (AdWords Scripts Team)

unread,
Jan 28, 2016, 9:22:51 AM1/28/16
to AdWords Scripts Forum
Thanks Jordan for the suggestion.

I will discuss with the rest of the team about these solutions.

Regards,
Tyler Sidell
AdWords Scripts Team

Tyler Sidell (AdWords Scripts Team)

unread,
Jun 7, 2016, 3:40:42 PM6/7/16
to AdWords Scripts Forum
Hi Jordan,

Just wanted to provide you an update that this is on our TODO list but we currently do not have an ETA.

Thanks,
Tyler Sidell
AdWords Scripts Team

Jordan McClements

unread,
Aug 8, 2016, 5:06:59 AM8/8/16
to AdWords Scripts Forum
Pretty please?

Tyler Sidell (AdWords Scripts Team)

unread,
Aug 8, 2016, 9:20:00 AM8/8/16
to AdWords Scripts Forum
Hi Jordan,

Good news!  As of version 2.0.2, you can now toggle if you want the script to checked paused entities directly from the template.  We would suggest that you upgrade your script and template to the new version.

Thanks,
Tyler Sidell
AdWords Scripts Team

Julien E.

unread,
Sep 8, 2016, 9:26:31 AM9/8/16
to AdWords Scripts Forum
Hi Tyler,

Thank you for this new release, I was looking forward to this to start using the script.

I do have a problem for the setup though, despite the configuration (I copied the sheet, inserted the url and my email), the script runs for only 2 sec, tells me 1 account has been checked (even though I have 7 accounts).

How could I get some help ?

Have a nice day

Tyler Sidell (AdWords Scripts Team)

unread,
Sep 8, 2016, 9:57:55 AM9/8/16
to AdWords Scripts Forum
Hi Julien,

This thread is getting a bit long.  Would you mind creating a separate thread for your issue?  It will help us better track your questions.

Thanks,
Tyler Sidell
AdWords Scripts Team

Julien E.

unread,
Sep 9, 2016, 4:08:01 AM9/9/16
to AdWords Scripts Forum
Hi Tyler,

Of course!
Reply all
Reply to author
Forward
0 new messages