Hello, In the future, could you please start a new thread with a link over to the thread that you're referencing? This really helps both our forum users and us. Since this is such a short question, I'll just answer it here.
We don't have an EXACT example for adding a user list as ad group criterion, but we do have a very close one. If you look at the example in Python for Add demographic targeting criteria to an ad group <https://developers.google.com/adwords/api/docs/samples/python/targeting#add-demographic-targeting-critera-to-an-ad-group>, you can change out the gender criterion for a user list criterion instead. The rest of the code would stay the same. Best, Nadine, AdWords API Team On Thursday, November 2, 2017 at 6:00:28 AM UTC-4, [email protected] wrote: > > Hey is there a link to a python version of this snippet? > > On Friday, January 27, 2017 at 1:20:29 PM UTC-6, Shwetha Vastrad (AdWords > API Team) wrote: >> >> Hi, >> >> To add an Audience to your AdGroups or Campaigns, you need to add a >> criterion of type CriterionUserList >> <https://developers.google.com/adwords/api/docs/reference/v201609/AdGroupCriterionService.CriterionUserList> >> using AdGroupCriterionService >> <https://developers.google.com/adwords/api/docs/reference/v201609/AdGroupCriterionService> >> or CampaignCriterionService >> <https://developers.google.com/adwords/api/docs/reference/v201609/CampaignCriterionService> >> respectively. >> You need to pass the ID of your user list in the userListId >> <https://developers.google.com/adwords/api/docs/reference/v201609/AdGroupCriterionService.CriterionUserList#userlistid> >> field. >> I'm afraid the library doesn't have an example to demonstrate this. The >> following code snippet adds an Audience to an AdGroup. >> >> CriterionUserList userList = new CriterionUserList(); >> userList.setUserListId(userListId); >> >> BiddableAdGroupCriterion criterion = new BiddableAdGroupCriterion(); >> criterion.setAdGroupId(adGroupId); >> criterion.setCriterion(userList); >> >> AdGroupCriterionOperation operation = new AdGroupCriterionOperation >> (); >> operation.setOperand(criterion); >> operation.setOperator(Operator.ADD); >> >> AdGroupCriterionOperation[] operations = new >> AdGroupCriterionOperation[] {operation}; >> AdGroupCriterionReturnValue result = adGroupCriterionService.mutate( >> operations); >> >> Regards, >> Shwetha, AdWords API Team. >> > -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and Google+: https://googleadsdeveloper.blogspot.com/ https://plus.google.com/+GoogleAdsDevelopers/posts =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/adwords-api?hl=en --- You received this message because you are subscribed to the Google Groups "AdWords API Forum" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at https://groups.google.com/group/adwords-api. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/3b36b97d-4337-4573-997a-9ff3f7624ffd%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
