Having used ServicedAccountService to get all the client accounts/MCC's I 
manage, how do I then specify which account I want to use CampaignService 
on?

Originally, I just tried using the CampaignService on it's own to bring 
back all campaigns, but this came back with No campaigns were found, so I 
am assuming I need to point to one of my client's accounts first.

This was the original code:

        $user = new AdWordsUser();

        $campaignService = $user->GetService('CampaignService', 'v201109');
      
        // Create selector.
        $selector = new Selector();
        $selector->fields = array('Id', 'Name');
        $selector->ordering = array(new OrderBy('Name', 'ASCENDING'));
        $selector->dateRange->min = "20120228";
        $selector->dateRange->max = "20120229";
      
        // Get all campaigns.
        $page = $campaignService->get($selector);
      
        // Display campaigns.
        if (isset($page->entries)) {
          foreach ($page->entries as $campaign) {
            print 'Campaign with name "' . $campaign->name . '" and id "'
                . $campaign->id . "\" was found.\n";
            $cost = $campaign->campaignStats->cost->microAmount/1000000;
            print "Cost for Campaign {$campaign->name} = $cost\n";
      
          }
        } else {
          print "No campaigns were found.\n";
        }

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to