Search Campaign Audience Selector - "Status" is an invalid field name...

22 views
Skip to first unread message

dominic.ch...@uswitch.com

unread,
Aug 17, 2017, 10:27:46 AM8/17/17
to AdWords API Forum
Hi,

I'm trying out AdWords Scripts and am trying to modify the audience lists for Campaigns.

To do this, I've been using the AdWords Docs which suggest that I can get the audiences of a campaign with

 
 var campaign = AdWordsApp.campaigns().withCondition('CampaignName = "My Campaign"').get().next()

 var audienceSelector = campaign.targeting()
     .audiences()
     .withCondition("Status = PAUSED")
     .get()



But when previewing the script, I get the following exception


Field name Status is invalid. Please check your spelling and casing.


Despite the Docs explicitly stating Status as a valid column?

Also, when just trying to iterate over all the audiences (as below), I always get an empty iterator despite the campaign containing multiple audiences...


 var campaign = AdWordsApp.campaigns().withCondition('CampaignName = "My Campaign"').get().next()
 var audiences = campaign.targeting().audiences().get()

 Logger.log(audiences.totalNumEntities())                            // Returns 0.0
 while (audiences.hasNext()) Logger.log(audiences.next().getName())  // Never enters while loop...




Any insight/help would be greatly appreciated!

Thanks,
Dom

Shwetha Vastrad (AdWords API Team)

unread,
Aug 17, 2017, 10:50:26 AM8/17/17
to AdWords API Forum
Hi Dom,

On this forum, we address questions related to AdWords API. Since your question is related to AdWords Scripts, I would suggest that you post it in the AdWords Scripts forum as they are better equipped to address this issue. 

Regards,
Shwetha Vastrad
AdWords API Team.
Reply all
Reply to author
Forward
0 new messages