Update Existing responsive Search Ads via Script

692 views
Skip to first unread message

Henrique Godinho

unread,
Mar 16, 2023, 9:00:08 AM3/16/23
to Google Ads Scripts Forum
Hello,

I am trying to update an existing responsive Search ads via script and I have tried so many things but nothing seems to work.

I can't seem to any relevant documentation on this either, nothing is related to update the ads, only to create new, add more to it or get information.

I am trying to update headlines and descriptions but everything I try, returns a TypeError: saying the method I tried is not a function.
I have tried:
getHealindes().set();
setHealines();
getHeadlines().setText();
getHeadlines().text();
and many others.

ChatGPT tried to help and I have tried countless variations but provided but nothing seems to work

The idea is quite simple. Grab and existing Ad by it's ID then update the headlines and descriptions via script.

e.g.:

let newHeadlines = [    {text: 'New headline 1'},    {text: 'New headline 2'},    {text: 'New headline 3'}  ];

let newDescriptions = [    {text: 'New description 1'},    {text: 'New description 2'}  ];
   
let ad = AdsApp.ads().withIds([['adgroupID', 'AdID']]).get().next();
   
    // code to update headlines and descriptions
   // e.g. ad.setHeadline(newHeadlines)
   // e.g. ad.setDEscriptions(newDescriptions)
 
    ad.apply();

Henrique Godinho

unread,
Mar 20, 2023, 11:33:21 AM3/20/23
to Google Ads Scripts Forum
Hello, just checking if would possible to have feedback from support here? thanks

Google Ads Scripts Forum

unread,
Mar 21, 2023, 8:11:48 AM3/21/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/74djSvPjcN8) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads Scripts Team

Google Ads Scripts Forum Advisor

unread,
Mar 21, 2023, 10:05:55 AM3/21/23
to adwords...@googlegroups.com

Hi Henrique,

 

It appears that you are using methods which do not exist currently for AdsApp.​ResponsiveSearchAd. You could use the bulk upload feature of Google Ads Scripts to achieve what you're aiming for. Please note that the supported bulk upload actions for an Ad entity are add, set, and remove only.

 

Let us know if you have any further clarifications.

 

Best regards,

 

Google Logo Google Ads Scripts Team


ref:_00D1U1174p._5004Q2k1Iyh:ref

Henrique Godinho

unread,
Mar 22, 2023, 6:27:58 AM3/22/23
to Google Ads Scripts Forum
Thanks for your reply. Just wanted to clarify that Google have methods for the creation of the Responsive Search Ads via script but have nothing available for updating them that is not a csv workaround? That sounds odd to me, as in, why would we build an ad via script then if we can update it via script?

Either way, do you know if there is any plans to provide users with simple methods to access ads properties?

Henrique Godinho

unread,
Mar 22, 2023, 8:30:13 AM3/22/23
to Google Ads Scripts Forum
I just tried a simple update to test it out but it doesn't seem to work. The script runs with no errors but nothing changes in the ad:

   
  const columns =["Campaign ID", "Ad group ID", "Ad ID", "Headline 1", "Headline 2", "Action"];
   
  const upload = AdsApp.bulkUploads().newCsvUpload(columns);
 
  upload.append({
    "Campaign ID": ******41813,
    "Ad Group ID": ******962152,
    "Ad ID": ******703523,
    "Headline 1": "This is a test",
    "Headline 2": "this is test #2",
    "Action": "set"
 
  });
  upload.forCampaignManagement();
  upload.apply();

Google Ads Scripts Forum Advisor

unread,
Mar 23, 2023, 4:49:05 AM3/23/23
to adwords...@googlegroups.com

Hi Henrique,

 

Thanks for getting back.

 

Kindly note that the results of your bulk upload can be seen in Tools and Settings > Bulk Actions > Uploads. That said, kindly update the script from `Ad Group ID` to `Ad group ID` as this is what's stated in the documentation of how the syntax is shown. I can confirm that the operation was successful after I had syntaxed it as such.

 

Let us know if you encounter any further issues.

Henrique Godinho

unread,
Mar 23, 2023, 6:51:02 AM3/23/23
to Google Ads Scripts Forum
Hello, thanks for the feedback.

I tried again and although the script runs, I get an error but the error description is not helpful. The error just says "An error occurred try again later".

See attached for your reference.

Also, I noticed that once I run the script and go into  Tools and Settings > Bulk Actions > Uploads I have an "apply" button. Does this mean that even if there was no errors I would have to manually click on the apply button for the changes to take effect?

Thanks.


Capture.PNG

Henrique Godinho

unread,
Mar 28, 2023, 4:32:39 AM3/28/23
to Google Ads Scripts Forum
Hello support, would be great to receive some feedback on my latest query as we are depending on this to move forward with a project. thanks.

Google Ads Scripts Forum

unread,
Mar 31, 2023, 1:36:41 AM3/31/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/74djSvPjcN8) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads Scripts Team

Google Ads Scripts Forum

unread,
Mar 31, 2023, 2:34:07 AM3/31/23
to Google Ads Scripts Forum
Hi Henrique,

It would be much appreciated if you could provide your Google Ads account ID or CID as well as the name of the script so we could further investigate the issue you've encountered.

To address your concern on the Apply button. If you meant that you've previewed the script using the apply() method, please note that the said method previews the Bulk Upload instead of applying it; this is also stated in the method's documentation. Hence, you would need to press the Apply button as it would only preview it.

Best regards,
Google Ads Scripts Team
Message has been deleted

Henrique Godinho

unread,
Mar 31, 2023, 5:29:15 AM3/31/23
to Google Ads Scripts Forum
Hello, I have replied to your message with the CID and script name via email, however, the message was posted here as well so I deleted it as it contained sensitive information. can you confirm you can still access the message I sent via email?

Thanks

Google Ads Scripts Forum

unread,
Apr 5, 2023, 3:10:41 AM4/5/23
to Google Ads Scripts Forum
Reposting the last inquiry (https://groups.google.com/g/adwords-scripts/c/74djSvPjcN8) from the forum as it wasn't routed to our support queue.

Regards,
Google Ads Scripts Team

Google Ads Scripts Forum

unread,
Apr 5, 2023, 3:15:36 AM4/5/23
to Google Ads Scripts Forum
Hi Henrique,

Please excuse us for only getting back now as your message failed to be routed to our support queue. We're hoping for your kind understanding on this. I'm afraid our team wasn't able to receive the email you mentioned you've sent.

Could you please provide your Google Ads account ID or CID, the name of the script as well as a complete and uncropped screenshot showing the error again so we could further investigate the issue you've encountered? You may send it privately via the Reply to author option. Note that you may need to join the Google Group for you to use this option. If this option is not available on your end still, you may send it through our email (googleadsscr...@google.com) instead.


Best regards,
Google Ads Scripts Team
Reply all
Reply to author
Forward
0 new messages