Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/nvuruPMn2tE) from the forum as it wasn't routed to our support queue.
Regards,
Google Ads Scripts Team
Hi,
Thank you for raising your concern to the Google Ads Scripts forum.
For us to check further, kindly provide the following information:
Google Ads account MCID
Name of the script on your account
Looking forward to your response.
Regards,
Google Ads Scripts Team
--
-- You received this message because you are subscribed to the Google Groups AdWords Scripts Forum group. Please do not reply to this email. To post to this group or unsubscribe please visit https://developers.google.com/adwords/scripts/community.
---
You received this message because you are subscribed to a topic in the Google Groups "Google Ads Scripts Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/adwords-scripts/nvuruPMn2tE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to adwords-scrip...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-scripts/e0285d53-e897-4cce-ad75-395b6114c5bbn%40googlegroups.com.
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/nvuruPMn2tE) from the forum as it wasn't routed to our support queue.
Regards,
Google Ads Scripts Team
Hi Daan,
Please excuse us for only getting back now as your message failed to be routed to our support queue.
I was able to check the script in the account and investigate further. I've observed that, upon retrieving the ads from the account and using the method getHeadline(), it appears that the ads in the account have no headlines as I was able to only retrieve a null value. This is likely why the error was encountered. The getHeadline() method would return a null value if the ad is not a text ad.
With this, I would recommend placing a condition which would filter specifically on a TEXT_AD or placing a condition wherein your script would execute when getHeadline() does not return a null value.
Lastly, I'm afraid that there isn't a method upon accessing an ad which lets you set it's headline using Google Ads Scripts methods. If you are building an ad, then you can supply a headline. You can check our documentation for the available ad builders currently for Google Ads Scripts.
Let us know if you have any clarifications.
Relevant links:
Best regards,
![]() |
Google Ads Scripts Team |