PHP Get active campaigns with less than 100 remarketing users

41 views
Skip to first unread message

Marketing Xilon

unread,
Oct 31, 2016, 4:33:04 PM10/31/16
to AdWords API Forum
Hello,

Using PHP, how can I get the list of et active campaigns with less than 100 remarketing users?

Thanks

Shwetha Vastrad (AdWords API Team)

unread,
Oct 31, 2016, 7:08:20 PM10/31/16
to AdWords API Forum
Hi,

For a CrmBasedEmailList, the user list size will show as zero until the list has at least 1,000 members. You could use AdwordsUserListService to retrieve the list of remarketing lists with size as zero, and then retrieve CampaignCriterion and AdGroupCriterion associated with these UserLists using predicates via CampaignCriterionService and AdGroupCriterionService respectively. You can retrieve the associated CampaignIds and their states. The code samples available here provide examples of basic operations using AdWords API PHP client library. 

I hope this helps. 

Regards,
Shwetha, AdWords API Team.

Marketing Xilon

unread,
Nov 1, 2016, 3:01:13 PM11/1/16
to AdWords API Forum
Hi Shwetha,

I'm afraid I'm a little confused about your explanation.

"You could use AdwordsUserListService to retrieve the list of remarketing lists with size as zero, and then retrieve CampaignCriterion and AdGroupCriterion associated with these UserLists using predicates via CampaignCriterionService and AdGroupCriterionService respectively"

What exactly may I get retrieving CampaignCriterion and AdGroupCriterion?

"You can retrieve the associated CampaignIds and their states"

Why should I need the states of the campaigns?

Thanks!

Shwetha Vastrad (AdWords API Team)

unread,
Nov 1, 2016, 5:58:28 PM11/1/16
to adwor...@googlegroups.com
Hi,

There is no straightforward way to get all enabled campaigns with less than 100 remarketing users. If you just want to get all enabled campaigns, you can use CampaignService as shown here using a predicate to filter for ENABLED campaigns. A campaign's state indicates if it is active or not. 

When you use remarketing lists for targeting, you are essentially creating CampaignCriterion or AdGroupCriterion of type USER_LIST. You need to use AdwordsUserListService to first retrieve the UserLists with size as 0. You can then query for data from Audience Performance Report using the following query and use the UserList names obtained above in the predicate:

SELECT Id, UserListName, AdGroupId, CampaignId FROM AUDIENCE_PERFORMANCE_REPORT WHERE CampaignStatus = 'ENABLED' AND UserListName IN [userList_names]

Let me know if this works. 

Marketing X

unread,
Nov 7, 2016, 6:38:17 PM11/7/16
to AdWords API Forum
Thank you for clarifying!
Reply all
Reply to author
Forward
0 new messages