Java API Cove Sample Campaign_Performance_Report

已查看 27 次
跳至第一个未读帖子

ntdm...@gmail.com

未读,
2016年10月12日 06:21:452016/10/12
收件人 AdWords API Forum
Im an newbie to adwords, Im trying to get campaign performance report where you can get most of the campaign details can anyone share a code snippet to retrieve it I am able to get the campaigns, adgroups and ads but I  need a detailing on Campaign on the number of clicks, impressions etc.

A code snippet for java api  will be very useful 
Thanks in advance,

Peter Oliquino

未读,
2016年10月12日 06:50:402016/10/12
收件人 AdWords API Forum
Hi,

You could try this example in Java and you may use the below sample AWQL query to generate the Campaign Performance Report :

String query = "SELECT CampaignId, CampaignName, Clicks, Impressions FROM CAMPAIGN_PERFORMANCE_REPORT"; 

For AdGroup and Ad performance specific reports, you may use the AdGroup Performance and Ad Performance reports respectively. You may also refer to this guide for more information regarding reports.

Best regards,
Peter
AdWords API Team

ntdm...@gmail.com

未读,
2016年10月12日 08:12:052016/10/12
收件人 AdWords API Forum
Hi Peter,

It was useful thanks for the update but i need it to be in a object not to download as a file, what are the classes used to get the response and execute the query(service objects and return type objects so i can use them to do further operations).

Peter Oliquino

未读,
2016年10月12日 23:14:412016/10/12
收件人 AdWords API Forum
Hi,

You may retrieve the response as a string object. Please refer to the below code for an example :

      ReportDownloadResponse response =
          new ReportDownloader(session).downloadReport(query, DownloadFormat.CSV);
      Comment out the save to file line
      //response.saveToFile(reportFile);
      String responseAsString = response.getAsString();
      You may then parse the String object as needed

Hope this helps.
回复全部
回复作者
转发
0 个新帖子