Keyword Performance Report help

39 views
Skip to first unread message

Stephen Barrett

unread,
May 9, 2018, 6:50:20 PM5/9/18
to AdWords API and Google Ads API Forum
I'm trying to pull Keyword Performance Report and I'm having trouble figuring out 

I want to use the AWQL method: 

// Create report query to get the data for last 7 days.
$reportQuery
= 'SELECT CampaignId, AdGroupId, Id, Criteria, CriteriaType, '
   
. 'Impressions, Clicks, Cost FROM KEYWORD_PERFORMANCE_REPORT '
   
. 'WHERE Status IN [ENABLED, PAUSED] DURING LAST_7_DAYS';

but I'm confused on how to implement it. Am I supposed to use the Query Method to pull this off? I'm looking at the examples and I don't see anything about where to put KEYWORD_PERFORMANCE_REPORT.

Right now I'm taking an example and just replacing the $query with what I need, but I don't know where to put KEYWORD_PERFORMANCE_REPORT. Am I suppose to put it as a use Google\AdsApi\Adwords\v201802\cm\...... and if so, I couldn't find a Keyword performance file to help me out.  

Any help would be greatly appreciated. 

Dannison Yao (AdWords API Team)

unread,
May 10, 2018, 12:08:27 AM5/10/18
to AdWords API and Google Ads API Forum
Hi Stephen,

Here is a sample PHP guide for you to better understand the implementation. Just change the report type definition to cater the type of report you want to generate. If your concern is where the download location will be, AdWords API automatically generates the report file in the temp folder which will be specified in the logs. More so, you can also specify the path where you want it to generate by adding this line of code.

$filePath = '/user/local/...'
$reportDownloadResult->saveToFile($filePath); 

Let me know if you have further concerns.

Regards,
Dannison
AdWords API Team

Stephen Barrett

unread,
May 10, 2018, 11:10:04 AM5/10/18
to AdWords API and Google Ads API Forum
So by changing the report type, would I have to also change the use cases too?
Screen Shot 2018-05-10 at 9.08.23 AM.png

Stephen Barrett

unread,
May 10, 2018, 11:45:57 AM5/10/18
to AdWords API and Google Ads API Forum
And update:

I tested that sample code just how it is and I'm getting a parse error.
Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/............../symfony/serializer/Normalizer/GetSetMethodNormalizer.php on line 59

I assume that the file it's mentioning doesn't have any errors. So I'm going to think its the sample file. I checked through the code and it doesn't look like anything is wrong with it either. any help?

Stephen Barrett

unread,
May 10, 2018, 4:09:17 PM5/10/18
to AdWords API and Google Ads API Forum
Another update. I've been working through this. And I had to update my PHP version to 7.0.29 in order to remove that error above. Now I'm not seeing any errors or anything.
Reply all
Reply to author
Forward
0 new messages