calculate the number of users into my audience???

61 views
Skip to first unread message

Harutyun Sardaryan

unread,
Apr 22, 2015, 9:14:05 AM4/22/15
to adwor...@googlegroups.com
Hi. How can I calculate the number of users into my audience??? Is there any built in function in google ads api?? 

Josh Radcliff (AdWords API Team)

unread,
Apr 22, 2015, 9:36:47 AM4/22/15
to adwor...@googlegroups.com
Hi,

You can issue an AdwordsUserListService.get request and check the size and sizeRange attributes of the returned UserList. Please see those links for more details.

Cheers,
Josh, AdWords API Team

ja...@safedatatech.com

unread,
May 1, 2015, 2:31:06 AM5/1/15
to adwor...@googlegroups.com
Thanks it was very helpfull. I've already found the solution. Here is my example

 //gets the total number of users into all of the audiences of our campaign
   public function getNumberOfUsersIntoAudiences(AdWordsUser $user) {
     // Get the services, which loads the required classes.
     $userListService = $user->GetService('AdwordsUserListService', ADWORDS_VERSION);
     $conversionTrackerService =
     $user->GetService('ConversionTrackerService', ADWORDS_VERSION);

     // Create remarketing user list.
     $userList = new BasicUserList();
     
     //Create selector object which will be used during sending the get request
     //to the server
     $selector = new Selector();
     //selector's fields property should contain a list of fields which we want to get from the server
     $selector->fields = array('Size', 'SizeRange');
     
     //sends the get request
     $result = $userListService->get($selector);
     
     return $result;

Josh Radcliff (AdWords API Team)

unread,
May 1, 2015, 8:49:57 AM5/1/15
to adwor...@googlegroups.com
Hi,

Glad to hear that worked for you. Thanks for posting your code -- this could be very helpful to others with the same question.
Reply all
Reply to author
Forward
0 new messages