How can I generate report using Google adwords api without downloading the file?

14 views
Skip to first unread message

Luis Manuel

unread,
Jul 19, 2019, 5:40:38 PM7/19/19
to AdWords API and Google Ads API Forum

Hi all,


I am using the adwords API with version v201809 and I have the following question.


How can I generate the report CAMPAIGN_PERFORMANCE_REPORT without downloading the file (for example just showing the result). Here is actually what I do:


$reportQuery = 'SELECT CampaignId,CampaignName, Impressions, Clicks, Ctr , Cost '
                    . ' FROM CAMPAIGN_PERFORMANCE_REPORT '
                    . ' WHERE CampaignId = '.$campaignId.' DURING '.$date.','.$date;

        // Download report.
        ReportUtils::DownloadReportWithAwql($reportQuery, $filePath, $user,$reportFormat, $options);
        $dataArray =file($filePath);

I download the file, then I read from the data to show it up.


Check the response of Anthony Madrigal answer but I am not clear with awql, since the example is in xml.


I hope you can help me.


Thanks.

 

This is the answer of the previous post.


[


$report = ReportUtils::DownloadReport($reportDefinition, NULL, $user, $options);

$xml 
= simplexml_load_string($report);
print "<pre>";
print_r
($xml);
print "</pre>"


]

Google Ads API Forum Advisor Prod

unread,
Jul 22, 2019, 2:05:00 AM7/22/19
to adwor...@googlegroups.com

Hi Luis,

You may refer to this sample on how to print the results from AdWords reports. You may find more examples here based on your preferred language.

Regards,
Hiroyuki
Google Ads API Team



ref:_00D1U1174p._5001UEFUdB:ref
Reply all
Reply to author
Forward
0 new messages