What are AudienceId's?

16 views
Skip to first unread message

Trine....@groupm.com

unread,
Jan 3, 2019, 4:12:28 PM1/3/19
to AdWords API and Google Ads API Forum
Hi! 

the following code gives me an error, because it does not recognize the audienceID. I have used the ones from the report called "uservertical::91800", and have tried just typing in numbers such as 1,2,3 etc. Why is it not updating? Can you help?

function interests() {

   var interests = []
   var campaignIterator = AdsApp.campaigns().withIds([1668598316]).get()
   while (campaignIterator.hasNext()){
     var campaign = campaignIterator.next()
     var adgroupIterator = campaign.adGroups().get()
     
     while (adgroupIterator.hasNext()){
       var adgroup = adgroupIterator.next()
        var audienceBuilder = adgroup.targeting().newUserListBuilder();
  var audienceOperation = audienceBuilder
    .withAudienceId(91800)              // required
    .withBidModifier(1.1)             // optional
  .build();                       // add the audience
var audience = audienceOperation.getResult()}}}
Reply all
Reply to author
Forward
0 new messages