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

59 views
Skip to first unread message

weedoi...@gmail.com

unread,
Dec 8, 2015, 8:58:47 AM12/8/15
to AdWords API Forum

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.

Anthony Madrigal

unread,
Dec 8, 2015, 9:54:55 AM12/8/15
to AdWords API Forum
Hello,

You could have your report returned as a string instead of downloading it. In order to do so, you should pass a NULL value in place of the $filePath as such:
$report = ReportUtils::DownloadReport($reportDefinition, NULL, $user, $options);

You also look at this previous post for more details since the user was trying to accomplish the same feature.

Cheers,
Anthony
AdWords API Team

Luis Manuel

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

Hello,


Did you manage to solve your query? I still have not been able to solve it and I have the same question, I have not found content with AWQL to help me solve it

Thanks
Reply all
Reply to author
Forward
0 new messages