Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error getting data metrics #161

Closed
miguelgracia opened this issue Jul 18, 2019 · 6 comments
Closed

Error getting data metrics #161

miguelgracia opened this issue Jul 18, 2019 · 6 comments
Assignees

Comments

@miguelgracia
Copy link

I am trying to execute a metric query, but the library returns the following error:

In Message.php line 1687:
Call to a member function jsonByteSize() on float

The query is the following

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.clicks,
metrics.cost_micros,metrics.impressions, metrics.conversions,
metrics.average_cpc,metrics.ctr 
FROM keyword_view 
WHERE segments.date DURING YESTERDAY AND campaign.id=xxxxx

Thanks for your help

@fiboknacky
Copy link
Member

@PierrickVoulet Would this be related to the C implementation?

@PierrickVoulet
Copy link
Collaborator

Hi,

@fiboknacky: actually this seems related to the Protobuf.

@miguelgracia I need your help to continue the investigation:

  • Could you run the command php -i | grep protobuf and let me know the output?
  • Could you provide the minimum script to reproduce this issue?

Thanks,

@fiboknacky
Copy link
Member

And what client library version are you using?

@miguelgracia
Copy link
Author

@fiboknacky. I was using V1 of the library. With V2 it works.

@PierrickVoulet This is the script to reproduce the error

GoogleMetricsIssue.zip

Just add the configuration parameters in the .ini file and in the file Metric.php

I hope this helps

@PierrickVoulet
Copy link
Collaborator

PierrickVoulet commented Jul 22, 2019

Thanks @miguelgracia, I reproduce the error on my side using GoogleAdsClientBuilder V1 and the PHP implementation of Protobuf only:

PHP Fatal error:  Uncaught Error: Call to a member function jsonByteSize() on float in /usr/local/google/home/pierrick/git/gh/fork/ga/google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php:1687
Stack trace:
#0 /usr/local/google/home/pierrick/git/gh/fork/ga/google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1828): Google\Protobuf\Internal\Message->fieldDataOnlyJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor), 0)
#1 /usr/local/google/home/pierrick/git/gh/fork/ga/google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1936): Google\Protobuf\Internal\Message->fieldJsonByteSize(Object(Google\Protobuf\Internal\FieldDescriptor))
#2 /usr/local/google/home/pierrick/git/gh/fork/ga/google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1687): Google\Protobuf\Internal\Message->jsonByteSize()
#3 /usr/local/google/home/pierrick/git/gh/fork/ga/google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1828): Goo in /usr/local/google/home/pierrick/git/gh/fork/ga/google-ads-php/vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php on line 1687

The error disappears if either I change to use GoogleAdsClientBuilder V2 or I change to use the C implementation of Protobuf.

The error looks similar to the issue #104 which was supposed to be fixed with V2 but never verified.

@miguelgracia because V2 fixes the issue, do you have the possibility to upgrade to this version?

@miguelgracia
Copy link
Author

Yes, no problem @PierrickVoulet, I have already migrated to v2.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants