Link Checker is throwing "TypeError: Cannot find function adType in object [IMAGE_AD]. (line 166)"

88 views
Skip to first unread message

Trevor

unread,
Dec 5, 2016, 6:54:25 PM12/5/16
to AdWords Scripts Forum
Using the newest version of the single account link checker from: https://developers.google.com/adwords/scripts/docs/solutions/link-checker

I've run the link checker quite a bit and have not encountered this issue before -- I'm digging into it on my own but haven't discovered a solution yet.

Thank you!

Paul Justine de Honor

unread,
Dec 5, 2016, 9:29:35 PM12/5/16
to AdWords Scripts Forum
Hi Trevor,

Could you provide the CID along with the name of the script? Please use reply privately to author.

Thanks,
Paul Justine De Honor
AdWords Scripts Team

Trevor

unread,
Dec 9, 2016, 1:51:51 PM12/9/16
to AdWords Scripts Forum
Hi Paul (and anyone else reading this),

It appears the issue is not unique to that account and is now showing up in another account with image ads. As the error only points to the catch { } for the URL checking function, I'm assuming it's in here:

function getAdAsText(ad) {
 
// There is no AdTypeSpace method for textAd
 
if (ad.getType() === 'TEXT_AD') {
   
return ad.getHeadline();
 
} else if (ad.isType().expandedTextAd()) {
   
var eta = ad.asType().expandedTextAd();
   
return eta.getHeadlinePart1() + ' - ' + eta.getHeadlinePart2();
 
} else if (ad.isType().gmailImageAd()) {
   
return ad.asType().gmailImageAd().getName();
 
} else if (ad.isType().gmailMultiProductAd()) {
   
return ad.asType().gmailMultiProductAd().getHeadline();
 
} else if (ad.isType().gmailSinglePromotionAd()) {
   
return ad.asType().gmailSinglePromotionAd().getHeadline();
 
} else if (ad.isType().html5Ad()) {
   
return ad.asType().html5Ad().getName();
 
} else if (ad.isType().imageAd()) {
   
return ad.adType().imageAd().getName();
 
} else if (ad.isType().responsiveDisplayAd()) {
   
return ad.asType().responsiveDisplayAd().getLongHeadline();
 
}
 
return 'N/A';
}

and related to some recent change in the image ad object.

I'd be happy to provide the CID for this as well, and as before the script was freshly copied from the Google solution page (https://developers.google.com/adwords/scripts/docs/solutions/link-checker) and the template was just created with no modification besides email options. As before, the script runs just fine if I pause all of the image ads and it doesn't try to check them.

Anash Oommen

unread,
Dec 9, 2016, 3:18:29 PM12/9/16
to AdWords Scripts Forum
Hi Trevor,

This looks like an issue on the published script. In the function

function getAdAsText(ad) {

the line that reads

return ad.adType().imageAd().getName();


should instead read

return ad.asType().imageAd().getName();


The method to be called is asType, not adType. Looks like a typo to me, I'll ask the team to roll out a fix.

Cheers
Anash P. Oommen,
AdWords Scripts Team.

Anash Oommen

unread,
Dec 9, 2016, 3:20:07 PM12/9/16
to AdWords Scripts Forum
I've also fixed the script in your account, so it should work fine.

Cheers,
Anash

Paweł Kumor

unread,
Dec 11, 2016, 7:56:09 AM12/11/16
to AdWords Scripts Forum
Hi Anash,
Script published under:
https://developers.google.com/adwords/scripts/docs/solutions/mccapp-link-checker
still has this error...

Regards,
Paweł

Tyler Sidell (AdWords Scripts Team)

unread,
Dec 12, 2016, 10:40:51 AM12/12/16
to AdWords Scripts Forum
Hi Pawel,

We are currently working on getting the script source code updated.  We hope to have the adjustment out shortly.

Thanks,
Tyler Sidell
AdWords Scripts Team

Tyler Sidell (AdWords Scripts Team)

unread,
Dec 12, 2016, 2:22:17 PM12/12/16
to AdWords Scripts Forum
Hi all,

The documentation for the Link Checker script has been updated.

Thanks,
Tyler Sidell
AdWords Scripts Team
Reply all
Reply to author
Forward
0 new messages