You are not logged in.
Pages: 1
Hello,
I am trying to connect to GA4 on our dev website but getting the error below. What is odd though, it worked locally(Mamp) but not on our dev server. Locally, I updated BigTree by copy/paste core files. Server, I updated 4.5.7 through BigTree.
Fatal error: Uncaught Error: Class 'Google\Analytics\Data\V1beta\BetaAnalyticsDataClient' not found in /.../core/inc/bigtree/apis/google-analytics-4.php:30 Stack trace: #0 /.../core/inc/bigtree/apis/google-analytics-4.php(146): BigTreeGoogleAnalytics4->getClient() #1 /.../core/admin/modules/developer/analytics/set-property-id.php(5): BigTreeGoogleAnalytics4->testCredentials() #2 /.../core/admin/router.php(549): include('/home/rfucli5/d...') #3 /.../core/launch.php(78): include('/home/rfucli5/d...') #4 /.../site/index.php(3): include('/home/rfucli5/d...') #5 {main} thrown in /.../core/inc/bigtree/apis/google-analytics-4.php on line 30
Any suggestions?
Thanks
Doon
Offline
Did you run composer update on the server? You might not have the composer package for the Google Analytics API or your composer.json file might not be the latest one from BigTree 4.5.7.
Offline
Tim, I did forget to run composer but after I ran composer update and tried again. Now a different error.
Composer.json file
{
"require": {
"aws/aws-sdk-php": "^3",
"oyejorge/less.php": "v1.7.0.14",
"ext-gd": "*",
"ext-json": "*",
"webonyx/graphql-php": "^14.3",
"predis/predis": "^1.1",
"psr/simple-cache": "^1.0",
"mrclay/jsmin-php": "^2.4",
"guzzlehttp/guzzle": "^7.4.5",
"google/analytics-data": "^0.10.0"
}
}
Error
Fatal error: Uncaught Error: Call to undefined function Google\Protobuf\Internal\bccomp() in /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php:961 Stack trace: #0 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1302): Google\Protobuf\Internal\Message->convertJsonValueToProtoValue(2, Object(Google\Protobuf\Internal\FieldDescriptor), true) #1 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1241): Google\Protobuf\Internal\Message->mergeFromArrayJsonImpl(Array, true) #2 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1338): Google\Protobuf\Internal\Message->mergeFromJsonArray(Array, true) #3 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(795): Google\Protobuf\Internal\Message->parseFromJsonStream(Object(Google\Protobuf\Internal\RawInputStream), true) #4 /.../ in /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php on line 961
Offline
Tim,
I'm not sure what happened but I didn't get the above error anymore but kept on getting the error message "The Property ID you entered does not appear to be valid.". Its odd because it works fine locally but not on our server.
What I did was export/import bigtree_settings table to my local and added the google analytics information. Then exported/imported the table back to our dev website on the server and everything looks to be working.
Offline
Very strange! Are your local and remote using different versions of PHP?
Offline
Same version, PHP 7.4.16.
Offline
Tim,
I thought I fixed the error by export/importing the table but wasn't getting new data. I ran "composer update" again but was getting error below again. To fix this error, I needed bcmath PHP extension installed. After it was installed, I was successful to set up GA4 through bigtree. Also make sure cron.php and cron-run.php have execute permissions.
In case anyone else runs into this issue.
Fatal error: Uncaught Error: Call to undefined function Google\Protobuf\Internal\bccomp() in /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php:961 Stack trace: #0 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1302): Google\Protobuf\Internal\Message->convertJsonValueToProtoValue(2, Object(Google\Protobuf\Internal\FieldDescriptor), true) #1 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1241): Google\Protobuf\Internal\Message->mergeFromArrayJsonImpl(Array, true) #2 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(1338): Google\Protobuf\Internal\Message->mergeFromJsonArray(Array, true) #3 /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php(795): Google\Protobuf\Internal\Message->parseFromJsonStream(Object(Google\Protobuf\Internal\RawInputStream), true) #4 /.../ in /.../vendor/google/protobuf/src/Google/Protobuf/Internal/Message.php on line 961
Offline
Pages: 1