Adding a Label to an Ad with certain ID

44 views
Skip to first unread message

Franck Yensid

unread,
Aug 19, 2019, 1:10:37 PM8/19/19
to Google Ads Scripts Forum
Hi,

I'm trying to apply a label to an add with a certain ID.
When I launch the script, the changes doesn't seem to trigger.

Here is my code

function main() {
  
   var adSelector = AdsApp
     .ads()
     .withIds([[73866472550, 372653620060]])

 var adIterator = adSelector.get();
 while (adIterator.hasNext()) {
   var ad = adIterator.next();
   ad.applyLabel('Monday 1');
   Logger.log("Label changed");

 }
}


Google Ads Scripts Forum Advisor Prod

unread,
Aug 19, 2019, 2:19:39 PM8/19/19
to adwords-scripts+apn2wqd0snoobtn3...@googlegroups.com, adwords-scripts+apn2wqd0snoobtn3...@googlegroups.co, adwords...@googlegroups.com
Hi Franck,

Can you verify that:
  1. the ID array elements are in the order ad group id, ad id, and are the correct ids
  2. the label exists already
If these two items are true, can you please provide any information given by the script log (e.g. any errors or confirmed changes)? If the 'label changed' print statement in your code does not log, then it means no such ad with the given IDs exists in the account (or the label does not exist).

Thanks,
Matt
Google Ads Scripts Team

ref:_00D1U1174p._5001UEJY6W:ref
Reply all
Reply to author
Forward
0 new messages