Hello,

we're running version 1.3.0 of the new ads API and I have been able to run 
the example query in this link 
<https://github.com/googleads/google-ads-php/blob/master/examples/Reporting/GetKeywordStats.php>.
 
However, when I try to modify the query and add metrics.conversion I run 
into a strange error.

Unknown error (0) Error: Call to a member function jsonByteSize() on float 
in 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php:1687
Stack trace:
#0 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1828):
 
Google\Protobuf\Internal\Message->fieldDataOnlyJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor),
 
0)
#1 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1936):
 
Google\Protobuf\Internal\Message->fieldJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor))
#2 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1687):
 
Google\Protobuf\Internal\Message->jsonByteSize()
#3 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1828):
 
Google\Protobuf\Internal\Message->fieldDataOnlyJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor),
 
Object(Google\Ads\GoogleAds\V1\Common\Metrics))
#4 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1936):
 
Google\Protobuf\Internal\Message->fieldJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor))
#5 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1687):
 
Google\Protobuf\Internal\Message->jsonByteSize()
#6 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1818):
 
Google\Protobuf\Internal\Message->fieldDataOnlyJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor),
 
Object(Google\Ads\GoogleAds\V1\Services\GoogleAdsRow))
#7 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1936):
 
Google\Protobuf\Internal\Message->fieldJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor))
#8 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1491):
 
Google\Protobuf\Internal\Message->jsonByteSize()
#9 
/data/home/conrad/www/adwords.winlocal.de/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V1/LogMessageFormatter.php(127):
 
Google\Protobuf\Internal\Message->serializeToJsonString()
#10 
/data/home/conrad/www/adwords.winlocal.de/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V1/GoogleAdsUnaryCallLogger.php(93):
 
Google\Ads\GoogleAds\Lib\V1\LogMessageFormatter->formatDetail(Array, Array, 
'googleads.googl...')
#11 
/data/home/conrad/www/adwords.winlocal.de/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V1/GoogleAdsLoggingUnaryCall.php(60):
 
Google\Ads\GoogleAds\Lib\V1\GoogleAdsUnaryCallLogger->logDetails(Array, 
Array)
#12 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/gax/src/Transport/GrpcTransport.php(242):
 
Google\Ads\GoogleAds\Lib\V1\GoogleAdsLoggingUnaryCall->wait()
#13 
/data/home/conrad/www/adwords.winlocal.de/vendor/guzzlehttp/promises/src/Promise.php(246):
 
Google\ApiCore\Transport\GrpcTransport->Google\ApiCore\Transport\{closure}(true)
#14 
/data/home/conrad/www/adwords.winlocal.de/vendor/guzzlehttp/promises/src/Promise.php(223):
 
GuzzleHttp\Promise\Promise->invokeWaitFn()
#15 
/data/home/conrad/www/adwords.winlocal.de/vendor/guzzlehttp/promises/src/Promise.php(267):
 
GuzzleHttp\Promise\Promise->waitIfPending()
#16 
/data/home/conrad/www/adwords.winlocal.de/vendor/guzzlehttp/promises/src/Promise.php(225):
 
GuzzleHttp\Promise\Promise->invokeWaitList()
#17 
/data/home/conrad/www/adwords.winlocal.de/vendor/guzzlehttp/promises/src/Promise.php(62):
 
GuzzleHttp\Promise\Promise->waitIfPending()
#18 
/data/home/conrad/www/adwords.winlocal.de/vendor/google/gax/src/GapicClientTrait.php(591):
 
GuzzleHttp\Promise\Promise->wait()
#19 
/data/home/conrad/www/adwords.winlocal.de/vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/V1/Services/Gapic/GoogleAdsServiceGapicClient.php(268):
 
Google\Ads\GoogleAds\V1\Services\Gapic\GoogleAdsServiceGapicClient->getPagedListResponse('Search',
 
Array, 'Google\\Ads\\Goog...', 
Object(Google\Ads\GoogleAds\V1\Services\SearchGoogleAdsRequest))
#20 
/data/home/conrad/www/adwords.winlocal.de/app/components/AdwordsClientComponent.php(152):
 
Google\Ads\GoogleAds\V1\Services\Gapic\GoogleAdsServiceGapicClient->search(1680026166,
 
'SELECT campaign...', Array)

Final query sent is:

$query =
"SELECT campaign.id, "
. "campaign.name, "
. "ad_group.id, "
. "ad_group.name, "
. "ad_group_criterion.criterion_id, "
. "ad_group_criterion.keyword.text, "
. "ad_group_criterion.keyword.match_type, "
. "metrics.impressions, "
. "metrics.all_conversions, "
. "metrics.clicks, "
. "metrics.cost_micros "
. "FROM keyword_view "
. "WHERE segments.date DURING LAST_7_DAYS "
. "AND campaign.advertising_channel_type = 'SEARCH' "
. "AND ad_group.status = 'ENABLED' "
. "AND ad_group_criterion.status IN ('ENABLED', 'PAUSED') "
// Limits to the 50 keywords with the most impressions in the date range.
. "ORDER BY metrics.impressions DESC "
. "LIMIT 50";

Thank you for helping.

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/8491a209-7503-41dd-a466-406536425a89%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to