Error with Criteria Performance Report

128 views
Skip to first unread message

Stephen Barrett

unread,
May 11, 2018, 12:53:05 PM5/11/18
to AdWords API and Google Ads API Forum
I'm receiving this error when I am running the example CRITERIA_PERFORMANCE_REPORT with AWQL. I was running it on a test account and thought it was because there is very minimal data in it, so I switched to an production account that I have and all my campaigns from another function pull in, but I'm still not getting anything from this report.

Parse error
: syntax error, unexpected '?', expecting variable (T_VARIABLE) in /home/......../wp-content/themes/clientTheme/adwords/symfony/serializer/Normalizer/AbstractObjectNormalizer.php on line 238

I recently upgraded my php version to its highest availability: 7.0.29. I cannot go any higher than that with the current web host.. I saw in another thread on here that the newer version of Adwords API for php requires 7.2. Could this be because of it. Should I be using an earlier version of Adwords api php?

I have soap logging set up, and it's not showing any errors in the log. The only error showing up is the one above. 

Dhanya Sundararaju (AdWords API Team)

unread,
May 11, 2018, 4:07:28 PM5/11/18
to AdWords API and Google Ads API Forum
Hi Stephen,

Could you please check out this post from the library's GitHub page and see if it fixes your issue? If not, could you please file an issue there so that the library owners can take a look? 

Regards,
Dhanya, AdWords API Team

Stephen Barrett

unread,
May 11, 2018, 4:12:47 PM5/11/18
to AdWords API and Google Ads API Forum
that post has nothing to do with this Parse error. 

Sreelakshmi Sasidharan (AdWords API Team)

unread,
May 14, 2018, 2:06:45 PM5/14/18
to AdWords API and Google Ads API Forum
Hi Stephen, 

Could you please share the code that is failing with this error? I can take a closer look. Please redact any confidential information that may be present in the code. 

Thanks,
Sreelakshmi, AdWords API Team

Stephen Barrett

unread,
May 14, 2018, 3:26:11 PM5/14/18
to AdWords API and Google Ads API Forum
I haven't changed any code in the symfony directory. So I'm assuming it's a php version error. I'm running php 7.0.29. This is the highest I can go for my website. It was suggested in another thread I am on to download Vendor again via Composer but with the local machine the same php version of my webhost. I have done that and the script is running successfully. It's throwing errors after I have moved it to the new environment. 

Sreelakshmi Sasidharan (AdWords API Team)

unread,
May 15, 2018, 11:30:33 AM5/15/18
to AdWords API and Google Ads API Forum
Hi Stephen, 

I was able to test the latest samples in a lower PHP version (PHP 7.0.26) than yours. Since the same code is working in your local machine too, it does look like the version is not the issue here. Could you confirm which PHP client library version you are using? Also, were you able to try after reinstalling the client library again via composer in the new environment? Let me know how it goes. 

Stephen Barrett

unread,
May 15, 2018, 12:02:23 PM5/15/18
to AdWords API and Google Ads API Forum
The changelog.md within the googleads-php-lib directory states that it's version 34.0.0. I was able to successfully make the call in my local setup, but not my webhost environment. 

Sreelakshmi Sasidharan (AdWords API Team)

unread,
May 15, 2018, 4:02:10 PM5/15/18
to AdWords API and Google Ads API Forum
Hi Stephen, 

The latest version of PHP client library that is currently available is googleads-php-lib-v34.0.0. Looks like you are already using the latest version. Could you please create an issue in the PHP client library with the detailed error logs from your webhost environment? The library owner is better equipped to assist you. 

Stephen Barrett

unread,
May 15, 2018, 4:21:28 PM5/15/18
to AdWords API and Google Ads API Forum
Is there a way for me to download a lesser version? I have changed my localhost to match my webhost's php version 7.0.30 and when I try and download the library through composer it no longer meets the requirements because the library requires php 7.1 or higher

Sreelakshmi Sasidharan (AdWords API Team)

unread,
May 16, 2018, 2:29:36 PM5/16/18
to AdWords API and Google Ads API Forum
Hi Stephen, 

Yes, you could update the desired version of the client library in the composer.json file and follow the installation steps

Luis Alegro

unread,
Sep 28, 2018, 4:31:03 PM9/28/18
to AdWords API and Google Ads API Forum
Hello, how are you?

I'm having the same problems.

In the localhost runs perfectly (php 7.2), in the web host (php 7.0) shows the error in the same file.

Were you able to solve this? or changed your web host

Stephen Barrett

unread,
Sep 28, 2018, 5:07:03 PM9/28/18
to AdWords API and Google Ads API Forum
Yes. I was able to figure it out. From what I remember you have to make sure both environments are the same version of PHP. So if your final environment is 7.0, you have to downgrade your php version on your localhost to 7.0. I used Homebrew to accomplish that.
Reply all
Reply to author
Forward
0 new messages