-
Troubleshooting Access Issues in PHP Google Analytics4 Admin
Hey, have you experienced this peculiar situation like I did? I was attempting to access a simple function in GA4 admin, and all of sudden I received this exception listing out all the issues (reason, status, message). Let me try to recreate what I did from the start:
First, I had a URL to do the redirect like this:
Do you see anything unusual in this part?
What followed next was the creation of a GoogleClient after receiving a callback code:
Now, this did seem to go as planned. Then, I made an attempt to get the access token from the obtained code:
And soon after, I managed to get an analytics client:
Following that, aiming for the account summaries seemed like the logical thing to do:
Here, things got a bit tricky. This particular action threw an exception:
Here comes the puzzling part. This is all fine and dandy in my development environment. As soon as I transitioned up to our staging testing environment, this problem began. Now, the project does have these APIs enabled, at least according to the console:
Google Analytics Admin API
Google Analytics API
Google Analytics Data APIMoreover, I’ve created a new Google account under this project (to the best of my knowledge), and that’s what I selected when the redirect prompted the permissions page.
Just to add, this question is refined from one I had previously posted and later removed. This version is more complete and reflects my progress more accurately.
Our API is still in alpha, do you know when the beta version will contain more functionalities? Or even better, when will the final code be released? We’re planning to start using GA4 in just a few months.
Lastly, here’s what my $OathKeyFile looks like:
Do you see any problems in these steps? Also, any idea what “WEIRD_PROJECT_ID” might refer to in the exception?
Log in to reply.