Hello All,

I've run into an issue and was hoping someone would point me in the right 

I'm using downloadReportWithAwql (client v201802) to run a query with the 
KEYWORDS_PERFORMANCE_REPORT - it's actually a query we use in an AdWords 
script and it works fine there.

But in the PHP script I'm writing some of the number columns return 
correctly, but others are not.

For example; "Search Impr. share" on one of our keywords is returning 44.83, 
which is correct, but on the same keyword the "Cost" is returning 7250000 
but the cost is actually 7.25

The cost field isn't the only one doing this. All of these fields are doing 
the same thing: "Avg. CPC", "CPC Bid", "Cost", "CPC" & "Conv. rate" (unless 
their value is 0, in that case it does spit out 0).

All other numeric fields are returning correctly. But these fields return 7 
digits. It appears the whole number separator ( . ) is missing and it's 
cramming all the decimals right into it. (ie x.xx becomes xxxxxxx and xx.xx 
also becomes xxxxxxx). If it was always one number before the decimal I'd 
just grab the first digit and drop in a decimal, but sometimes it's a value 
like 12.54 becoming 1253267. So that won't work.

Here's a slightly modified version of the code:

private function get_data() {
$reportFormat = DownloadFormat::CSV;
$oAuth2Credential = (new OAuth2TokenBuilder())
->fromFile( self::$ini_path )

$session = (new AdWordsSessionBuilder())
->fromFile( self::$ini_path )
->withOAuth2Credential( $oAuth2Credential )
->withClientCustomerId( self::$client_id )

$adWordsServices = new AdWordsServices();
$reportQuery = $this->query( 'KEYWORDS_PERFORMANCE_REPORT' );
/* This is an example of the returned value of $reportQuery
IsNegative = FALSE
AND AdGroupStatus = ENABLED
AND CampaignStatus = ENABLED
DURING 20170911,20180309

$reportDownloader = new ReportDownloader( $session );

$reportSettingsOverride = ( new ReportSettingsBuilder() )
->includeZeroImpressions( false )

$reportDownloadResult = $reportDownloader->downloadReportWithAwql(

return $reportDownloadResult->getAsString();

This is an example of what it's kicking out:

"KEYWORDS_PERFORMANCE_REPORT (Sep 11, 2017-Mar 9, 2018)"
Keyword,Campaign,Ad group,Match type,Clicks,Impressions,CTR,Avg. CPC,Max. 
CPC,Cost,Avg. position,Conversions,Cost / conv.,Conv. rate,Search Impr. 
share,Quality score

Obviously I switched out the keywords, campaigns and ad group names. But 
what's going on with the 7 digit numerical values?

If anyone can shed any light on this and steer me in the right direction I 
would greatly appreciate it. I don't have much hair left and you'd be 
saving me from pulling what little remains out.


Also find us on our blog and Google+:

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
For more options, visit this group at
You received this message because you are subscribed to the Google Groups 
"AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to