I'm trying to implement the reporting section of the RMF.
When I implemented the *ACCOUNT_PERFORMANCE_REPORT type I got an empty
reports (with zeros).
I guess this was OK due to the fact this is a sandbox environment with no
real activity.*
**
*I next tried to build a Campaign performance report and I got a single row
report where all the values where "--".*
*I guess I am doing something wrong.
I want to report on a single campaign at a time (I created a Predicate and
set the CampaignId).
What can be the problem?
Bellow is the code.*
*Thanks.*
**
// Create selector.
Selector selector = new Selector();
List<String> fields = selector.getFields();
fields.add("CampaignId");
fields.add("CampaignName");
fields.add("Status");
fields.add("Clicks");
fields.add("Cost");
fields.add("Impressions");
fields.add("AverageCpc");
fields.add("Ctr");
fields.add("AverageCpm");
fields.add("AveragePosition");
fields.add("ConversionRate");
fields.add("AdNetworkType1");
fields.add("Device");
fields.add("ClickType");
List<Predicate> peridicates = selector.getPredicates();
// Create Campaign predicate
Predicate campaignPredicate = new Predicate();
campaignPredicate.setField("CampaignId");
campaignPredicate.setOperator(PredicateOperator.EQUALS);
campaignPredicate.getValues().add(String.valueOf(pCamapaignID));
// Create report definition.
ReportDefinition reportDefinition = new ReportDefinition();
reportDefinition.setReportName("Campaign Performance report for
Campaign:" + machine.getMachineName());
reportDefinition.setDateRangeType(ReportDefinitionDateRangeType.YESTERDAY);
reportDefinition.setReportType(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT);
reportDefinition.setDownloadFormat(DownloadFormat.CSVFOREXCEL);
reportDefinition.setIncludeZeroImpressions(true);
reportDefinition.setSelector(selector);
File newFile = File.createTempFile("reportDownload-" + 123 +
"-",".csv");
FileOutputStream fos = new FileOutputStream(newFile);
ReportDownloadResponse reportResponse =
ReportUtils.downloadReport(user, reportDefinition, fos);
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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