Hey,

It returns all the adGroups in the selected campaign.

I tried this approach to which did not work as well

  $selector->paging = new Paging();
  $selector->paging->startIndex=0; 
  $selector->paging->numberResults = 25;


Any idea what i'm doing wrong?

Thanks

On Tuesday, March 11, 2014 11:17:34 AM UTC-4, [email protected] wrote:
>
> *v201402*
>
> function GetAdGroupsExample(AdWordsUser $user, $campaignId) {
>   // Get the service, which loads the required classes.
>   $adGroupService = $user->GetService('AdGroupService', ADWORDS_VERSION);
>
>   // Create selector.
>   $selector = new Selector();
>   $selector->fields = array('Id', 'Name');
>   $selector->ordering[] = new OrderBy('Name', 'ASCENDING');
>
>   // Create predicates.
>   $selector->predicates[] =
>       new Predicate('CampaignId', 'IN', array($campaignId));
>
>   // Create paging controls.
>   $selector->paging = new Paging(0, 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE);
>
>   do {
>     // Make the get request.
>     $page = $adGroupService->get($selector);
>
>     // Display results.
>     if (isset($page->entries)) {
>       foreach ($page->entries as $adGroup) {
>         printf("Ad group with name '%s' and ID '%s' was found.\n",
>             $adGroup->name, $adGroup->id);
>       }
>     } else {
>       print "No ad groups were found.\n";
>     }
>
>     // Advance the paging index.
>     $selector->paging->startIndex += 
> AdWordsConstants::RECOMMENDED_PAGE_SIZE;
>   } while ($page->totalNumEntries > $selector->paging->startIndex);
> }
>
>
>
>
>
> ------------------
>
> I'm trying to get 100 results at the time
>
> Thanks
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to