We are developing a web application Known as clevermoe.It is an advertising app .In our app customers Place an ad in six different Ad networks at the sametime and we also display their ad results in our application.These are done through Api's of corresponding Ad networks.For that Purpose we are using ReportQuery api(getting campaign performance report) in youtube. In this api we are facing an issue, we are getting the value without decimal points for cost,AverageCpc and Average Cpm and sometimes provide wrong values.I have attached Google ad Dashboard Image and Our Output Image.
CodeSnippet:
ReportQuery query = new ReportQuery.Builder()
.fields("Impressions", "Engagements", "Clicks", "AverageCpc", "AverageCpm",
"VideoViews", "CampaignStatus", "Cost")
.from(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT).where("CampaignId")
.in(campaignIdFromGoogleAds).build();
ReportingConfiguration reportingConfiguration = new ReportingConfiguration.Builder()
.skipReportHeader(false).skipColumnHeader(false).skipReportSummary(false)
.includeZeroImpressions(true).build();
session.setReportingConfiguration(reportingConfiguration);
ReportDownloaderInterface reportDownloader = adWordsServices.getUtility(session,
ReportDownloaderInterface.class);
ReportDownloadResponse response = reportDownloader.downloadReport(query.toString(),
DownloadFormat.CSV);
String output = response.getAsString();
Thanks&Regards
Rubanselva v