In order to get stats - you need to create & include a statsSelector object with the appropriate date range set. Otherwise no stats will be returned.
Kevin On Jan 5, 1:23 am, renuka dasari <[email protected]> wrote: > I want to get number of today's clicks for a specific campaign. Im > using PHP Client Library for this.I have updated auth.ini file with my > client login details. > > Below Page Link : Google/examples/v201008/GetAllCampaigns.php > > $path = dirname(__FILE__) . '/../../src'; > set_include_path(get_include_path() . PATH_SEPARATOR . $path); > > require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php'; > > try { > // Get AdWordsUser from credentials in "../auth.ini" > // relative to the AdWordsUser.php file's directory. > $user = new AdWordsUser(); > > // Log SOAP XML request and response. > $user->LogDefaults(); > > // Get the CampaignService. > $campaignService = $user->GetCampaignService('v201008'); > > // Create selector. > $selector = new CampaignSelector(); > > // Get all campaigns. > $page = $campaignService->get($selector); > > echo '<pre>'; > print_r($page); > echo '<pre>'; > > // Display campaigns. > if (isset($page->entries)) { > > foreach ($page->entries as $campaign) { > print 'Campaign with name "'.$campaign->name.'" and id "'. > $campaign->id."\" was found.\n"; > > print 'Campaign network :'.$campaign->campaignStats->network.', > Campaign Clicks :'. $campaign->campaignStats->clicks; > > echo '<br/><br/>'; > } > > } else { > print "No campaigns were found.\n"; > }} catch (Exception $e) { > > print $e->getMessage(); > > } > > Here im fetching clicks of a all the campaigns of client. But clicks > are not displaying. > Please help me. > > Regards, > Renuka -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 [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
