Google Ads PHP client library V2 fail get conversions and conversions_values from hotel_performance_view with

50 views
Skip to first unread message

Didier Roy

unread,
Sep 6, 2019, 11:10:43 AM9/6/19
to AdWords API and Google Ads API Forum
Hello

PHP issue trying  to get conversions and conversions_values from hotel_performance_view with Google Ads PHP client library V2

PHP Fatal error:  Uncaught Exception: Expect float. in /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php:182
Stack trace:
#0 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(61): Google\Protobuf\Internal\GPBUtil::checkDouble(Object(Google\Protobuf\DoubleValue))
#1 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1009): Google\Protobuf\DoubleValue->setValue(Object(Google\Protobuf\DoubleValue))
#2 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(79): Google\Protobuf\Internal\Message->mergeFromArray(Array)
#3 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(38): Google\Protobuf\Internal\Message->__construct(Array)
#4 /home/metaio-dev-v5/google-ads-php/V2/src/Google/Ads/GoogleAds/V1/Common/Metrics.php(3960): Google\Protobuf\DoubleValue->__construct(Array)
#5 /home/metaio-dev-v5/goo in /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php on line 182

this is the request :
SELECT campaign.id,campaign.name,campaign.advertising_channel_type,segments.date,metrics.clicks,metrics.conversions,metrics.conversions_value FROM hotel_performance_view WHERE segments.date >= '2019-08-07' and segments.date <= '2019-09-05' and campaign.advertising_channel_type = 'HOTEL'

Remark : when I remove metrics.conversions and metrics.conversions_value from the request it doesn't fail

thanks
Didier

Google Ads API Forum Advisor Prod

unread,
Sep 9, 2019, 11:54:09 AM9/9/19
to did...@wihphotels.com, adwor...@googlegroups.com
Hello Didier,

I am form the Google Ads API team. I was able to make successful API call with the search query you have shared without any errors. Could you please share the exact error message/error log you are facing to help further? Please use reply privately to the author option while sharing the information requested.

Regards,
Sai Teja, Google Ads API Team
 

ref:_00D1U1174p._5001UHFxXv:ref

Didier Roy

unread,
Sep 9, 2019, 1:48:36 PM9/9/19
to AdWords API and Google Ads API Forum
Hello Sai

the error is a PHP error. It occurs before the API call is done. There is no log of the request into the log.
it seems to be a PHP client library bug. I have tried V2 and V1 and got the same error

PHP Fatal error:  Uncaught Exception: Expect float. in /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php:182
Stack trace:
#0 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(61): Google\Protobuf\Internal\GPBUtil::checkDouble(Object(Google\Protobuf\DoubleValue))
#1 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1009): Google\Protobuf\DoubleValue->setValue(Object(Google\Protobuf\DoubleValue))
#2 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(79): Google\Protobuf\Internal\Message->mergeFromArray(Array)
#3 /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/DoubleValue.php(38): Google\Protobuf\Internal\Message->__construct(Array)
#4 /home/metaio-dev-v5/google-ads-php/V2/src/Google/Ads/GoogleAds/V1/Common/Metrics.php(3960): Google\Protobuf\DoubleValue->__construct(Array)
#5 /home/metaio-dev-v5/goo in /home/metaio-dev-v5/google-ads-php/V2/vendor/google/protobuf/src/Google/Protobuf/Internal/GPBUtil.php on line 182

Regards
Didier

Adrian Lara

unread,
Sep 9, 2019, 1:57:14 PM9/9/19
to did...@wihphotels.com, AdWords API and Google Ads API Forum

The problem is you need convert 1 parameter  in to DoubleValue.

 

adrian

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
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 adwords-api...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/7809a5c6-987a-49ad-a85b-387022440fd4%40googlegroups.com.

Google Ads API Forum Advisor Prod

unread,
Sep 9, 2019, 3:02:33 PM9/9/19
to did...@wihphotels.com, adwor...@googlegroups.com
Hello Didier,

As Adrian said the error looks like due to data type needed to be double value. Also it is mentioned here for conversions_value and conversions metrics data types are Double. If you are still facing the problem with the PHP implementation of this can file an issue under the issue tracker here. Our PHP client library owner will assist you better.

Didier Roy

unread,
Sep 10, 2019, 3:22:12 AM9/10/19
to AdWords API and Google Ads API Forum
Hello Adrian

thank you for your answer.
I am making a request using PHP client Library
this is the requet I am submitting wihp PHP client Library :

SELECT campaign.id,campaign.name,campaign.advertising_channel_type,segments.date,metrics.clicks,metrics.conversions,metrics.conversions_value FROM hotel_performance_view WHERE segments.date >= '2019-08-07' and segments.date <= '2019-09-05' and campaign.advertising_channel_type = 'HOTEL'

I submit it this way :
 $response = self::$googleAdsServiceClient->search($customerId, $query, ['pageSize' => self::PAGE_SIZE]);

The PHP error occurs while PHP client Library si preparing the request and before it submit it to google ads API
I don't see how I can convert anything unless debugging myself PHP client library

regards



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 adwor...@googlegroups.com.

Google Ads API Forum Advisor Prod

unread,
Sep 10, 2019, 1:04:30 PM9/10/19
to did...@wihphotels.com, adwor...@googlegroups.com
Hello Didier,

I understand your concern. Since your concern is specific to PHP client library please file an issue under the issue tracker here. Our PHP client library owners are better equipped to help with your concerns.
Reply all
Reply to author
Forward
0 new messages