i am using this below code to get Adwards Campaign data reports in CSV.
I want to get " adwords campaign, adgroup ".
with this below code i am getting error Invalid field name in CampaignName
$user = new AdWordsUser();
$user->SetOAuth2Info($oauth2_info);
$user->SetClientCustomerId($client_id);
$user->LogAll();
$user->LoadService('ReportDefinitionService', ADWORDS_VERSION);
// Create selector.
$selector = new Selector();
$selector->fields = array(
'AdGroupId',
'CampaignId',
'CampaignName',
'GclId',
'CriteriaId',
'CriteriaParameters',
'Date'
);
// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->selector = $selector;
$reportDefinition->reportName = 'Click Performance Report #' .
uniqid();
$reportDefinition->dateRangeType = 'CUSTOM_DATE';
$dateRange = new DateRange();
$dateRange->min = $start_date;
//$dateRange->min = "20150626";
$dateRange->max = $end_date;
//$dateRange->max = "20150626";
$selector->dateRange = $dateRange;
//pr($dateRange); die;
$reportDefinition->reportType = 'CLICK_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'CSV';
// Exclude criteria that haven't recieved any impressions over
the date range.
$reportDefinition->includeZeroImpressions = FALSE;
// Set additional options.
$options = array('version' => ADWORDS_VERSION);
$path = $this->path;
$file_name = 'click_performance_report_' . time() . ".csv";
$this->file_name = $file_name;
$filePath = $path . $file_name;
// Download report.
ReportUtils::DownloadReport($reportDefinition, $filePath, $user,
$options);
$flag = true;
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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].
Visit this group at http://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/ca5a9b77-947f-47d4-a171-2d82bb4e55ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.