Fatal Error New Google Analytics update


Thanks for update the Google analytics.

I managed to follow all the steps in the documentation, but I encountered a fatal error:

Ένα σφάλμα τύπου E_ERROR εντοπίστηκε στη γραμμή 267 του αρχείου /home/www//wp-content/plugins/mainwp-google-analytics-extension/lib/php-analytics-admin/vendor/google/gax/src/ApiException.php](http:///wp-content/plugins/mainwp-google-analytics-extension/lib/php-analytics-admin/vendor/google/gax/src/ApiException.php). Κωδικός σφάλματος: Uncaught Google\ApiCore\ApiException: {
“domain”: “googleapis.com”,
“errorInfoMetadata”: {
“consumer”: "projects/57156236
“service”: “analyticsadmin.googleapis.com
“message”: “Google Analytics Admin API has not been used in project 57156236*** before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/analyticsadmin.googleapis.com/overview?project=57156236*** then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.”,
“code”: 7,
“details”: [
@type”: “type.googleapis.com/google.rpc.Help”,
“links”: [
“description”: “Google developers console API activation”,
“url”: “https://console.developers.google.com/apis/api/analyticsadmin.googleapis.com/overview?project=57156236***”
Also I delete the plugin and reactivated and the 2 buttons bellow is doing nothing when I press them.

1 Like

Hi @webtailors, did you get this error when you uploaded the JSON key?
If yes, can you please make sure that you downloaded correct one?

I have seen this problem when JSON key is downloaded from the oAuth2 section, instead of the Service Account.

Please review the Google Analytics Extension - MainWP Documentation help document and check the Step 10.

Let me know how it goes.

1 Like

In the first place, I entered the correct one: ultimate-result-310117-55743*****.json, and I get the fatal error.

Then, just for testing purposes, I tried using the wrong one: client_secret_571562*****-m0q0kh3hv6mr7s0jlvljo9********l4.

The problem now is that I’m unable to remove the accounts and add the .json file again, no matter what I do.

Thanks for the update.

Did you get “Critical error” when you tried intentionally adding the wrong JSON?

Did all JSON uploads create an account in the Manage Accounts tab?
Do you get any error when trying to remove them?

I’m having also problems with the JSON file… :frowning:

@Virgil, are you sure you used the correct JSON Key file?

If you download the file from the OAuth2 area, Google API library errors.
It is required to get the file from the Service Account area.

If you downloaded from here:

or here:

that is not good.

First, you need to access the Service Account:

there you can create JSON Key:


1 Like

Just for note, I am not sure why the Google GA API library does not process incorrect files in a more user-friendly way. But we are checking if something on our end can be done to prevent this.


Hello again,

I restored the mainwp from yesterday’s backup.

I retraced the steps, and now only one analytics account is visible in the settings.

However, I am having trouble with this account. When I try to access the site, the icon in the image below is not clickable.

Hi @webtailors,

It looks like the previous problem caused some errors. We are working on this, and we should have a solution soon.

Just to be sure, is everything fully functional after you temporarily disable the GA extension?

No, even if I delete the plugin, some things still don’t work properly. For example, the “Sync Dashboard with Sites” is not clickable. Only after restoring it, everything works fine.
I just restore again :slight_smile:

Thanks for confirming, we will look into this.

1 Like

I’ve done this, but still not working. WordPress gives a critical error. I regret that I’ve updated so early after release.

Hi Virgil,

Please feel free to reach out to us via helpdesk ticket so we can check this further for you.

We have just released a hotfix version 4.1.1.

It resolves the error caused by uploading the incorrect JSON Key file. You should now be able to load the Google Analytics page on your MainWP Dashboard and remove accounts.

We have also added a check which will look for incompatible JSON Key file and reject the upload if found.


Thanks @bojan for quick reaction.

The instartion here is for multible website or for one?
I managed to integrate, but only one site shows, and even that one doesn’t have any data.

You can multiple Google Analytics accounts to the extension, and each Google Analytics account can multiple websites.

After you add GA accounts to the extension via JSON Key files, you need to assign a Google Analytics property to a child site. You can find more information in the help document: Google Analytics Extension - MainWP Documentation

@bojan FYI the link in the plugin to the docs is incorrect

Thanks @eSIlverStrike. We’ll have that fixed.

I’m not receiving an error, but I am only able to receive just one child site’s data.

Setting up this OAuth & Service Account appears to be working because I am receiving data from one of the 3 sites I connected to MainWP. However, this one site is the only one showing data from the 3 sites I linked to MainWP.

I have added the Service Account email to all 3 GA4 accounts as a viewer, see below and these sites are showing up in the Visitor Data dropdown as well as when I connect the GA4 account to the child site edit.

Below are all the API, GA4, and MainWP screenshots.

Hi @kwsim

Thanks for reporting this to us.

Let’s continue solving this issue in the other thread dedicated to this issue.

I’ll mark this thread os Solved since it’s related to a bug that was fixed with v4.1.1.

1 Like