hi I want to retrive 
the following details
1- campaign budget info
1a- ad spend in dollars
1b- clicks
1d- click through percentage
1e- average cpc

I am using following code for retriving clicks and campaign budget but not 
getting any values
what should I do to retrive these values 
<?php
error_reporting(E_STRICT | E_ALL);

// You can set the include path to src directory or reference
// AdWordsUser.php directly via require_once.
// $path = '/path/to/aw_api_php_lib/src';
$path = dirname(__FILE__) . '/src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

require_once 'src/Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
require_once 'src/Google/Api/Ads/Common/Lib/SoapClientFactory.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('v201101');


  // Create selector.
  $selector = new Selector();
  $selector->fields = array('Id', 'Name','Status');
  $selector->ordering = array(new OrderBy('Name', 'ASCENDING'));
  $selector->dateRange = new DateRange();
  /****************************************************
  /*Creating Date                                      
  /*****************************************************/
    /* @var $max date */
  $min = mktime(0,0,0,date("m"),date("d")-1,date("Y"));
  $selector->dateRange->min = date("Ymd", $min);
  $selector->dateRange->max = date("Ymd");

// Get all campaigns.
  $page = $campaignService->get($selector);

  // Display campaigns.
  if (isset($page->entries)) {
      echo '<table border="1" class="Camp"><th>AdWords Campaign 
Present</th><tr><td>Name</td><td>ID</td><td>Campaign 
Clicks</td><td>Budget</td></tr>';
    foreach ($page->entries as $campaign) {
       print '<tr><td>' . $campaign->name . '</td><td>'
          . $campaign->id . '</td><td>'. 
$campaign->campaignStats->clicks.'</td><td>'. 
$campaign->campaignStats->budget
               .'</td><td>'.$campaign->campaignStats->startDate.'</td>
              
<td>'.$campaign->campaignStats->endDate.'</td><td>'.$campaign->status.'</td></tr>';
    }
    echo '</table><br>';
  } else {
    print "No campaigns were found Please craete ads to get the details.\n";
  }

  
} catch (Exception $e) {
  print $e->getMessage();
}
?>

I also retrived the feilds of Campaign Performance Report but not able to 
get the values stored in thos feilds
what should I do to get all these values.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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