Analytics Import Error

We have followed the instructions to import google analytics data step by step. Nevertheless we receive the following error message.
Could the support team access our installation?

Bildschirmfoto 2021-04-20 um 10.51.30

Getting the same error after 7 days… probably because the token expires.

Clicking “RE-AUTHORIZE” at the top on the Google Analytics Import settings page every 7 days works for us.

2 Likes

Hi @thomas.kettner, is this immediately after authorizing, or is it as @euklid describes the token expires after a certain amount of time? If it’s expiring after working for a while, it is likely due to Google revoking permissions for the token, which happens sometimes for apps in the Google developer console marked as test apps. We’ve found one potential solution so far that doesn’t require constantly reauthenticating but we haven’t tested it yet: https://stackoverflow.com/questions/66058279/token-has-been-expired-or-revoked-google-oauth2-refresh-token-gets-expired-i

After running the import for a few weeks now with manually “re-authorizing” once a week I now also received this error message:

Error message: Error on day 2018-04-26, { “error”: { “code”: 401, “message”: “Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.”, “errors”: [ { “message”: “Invalid Credentials”, “domain”: “global”, “reason”: “authError”, “location”: “Authorization”, “locationType”: “header” } ], “status”: “UNAUTHENTICATED” } }

Going to the Google Security Check-up in my Google account also revealed the app’s activity got flagged under “Recent security activity” (as described on Stack Overflow) and I had to Dismiss it to get the import working again.

1 Like

Hi,

Same issue. Just after following this tutorial => https://matomo.org/docs/google-analytics-importer/

errored
Message d’erreur: Error on day 2015-12-17, { “error”: { “code”: 401, “message”: “Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.”, “errors”: [ { “message”: “Invalid Credentials”, “domain”: “global”, “reason”: “authError”, “location”: “Authorization”, “locationType”: “header” } ], “status”: “UNAUTHENTICATED” } }
Ces erreurs sont inattendues et continueront probablement chaque fois que vous exécuterez l’importation ce jour-là. Pour résoudre ce problème, veuillez ask sur les forums. Si vous pouvez fournir l’accès à votre compte GA à un membre de l’équipe d’assistance de Matomo, cela fournira une résolution plus rapide.

Difficult to understand “invalid authentication credentials” because a first piece of data was imported, but the process was interrupted by this message.

Maybe it’s because the limit of Google per day has been reached?

Nevertheless the error message is confusing.

Matomo log indicate:

DEBUG [2022-03-04 10:39:00] 38718 Google Analytics returned an error: {
“error”: {
“code”: 429,
“message”: “Quota Error: profileId 914xxxx3 has exceeded the daily request limit.”,
“errors”: [
{
“message”: “Quota Error: profileId 914xxxx3 has exceeded the daily request limit.”,
“domain”: “global”,
“reason”: “rateLimitExceeded”
}
],
“status”: “RESOURCE_EXHAUSTED”
}
}

INFO [2022-03-04 10:39:00] 38718 Daily rate limit reached, try again tomorrow. (Note: GA by default sets a daily limit on the number of API requests made each day to 50000. It looks like you’ve reached this limit. Continue the import tomorrow.)
Error encountered, aborting.

Google API indicate:

Request for today 10022

Have anybody found a solution to this problem? Unfortunately I haven’t :blush:.

Just for reference, 2 recent posts about this issue (no solution found):

@innocraft @SteveG any idea?
Also if someone can create an issue in the GitHub Repo (I did not found anything about this subject):

1 Like

Hi @nternstedt @100son_net ,

Do you see any error under “Admin (cog icon) > System > Search performance”?

Hi @karthik,

I don’t have that option under system. I think you only have the option if you have the plugin search engine keywords performance.

Hi again @karthik, @innocraft

Do you guys have any solutions to this problem? Every day the same problem occur and after I re-authorizing Google Analytics importer plugin it works fine until next day when it breaks again.

Hi @nternstedt ,

Could you please get in touch with our support team at support@matomo.org. We may need more information to troubleshoot, forum may not be efficient for this.

@karthik any news on this?
@Criss, is also waiting for answers on this topic on:

Have anybody found a solution to this problem? Unfortunately I haven’t, This website https://pjlt20.com/palyers-draft/ also facing that

@innocraft @karthik do you have any clue on that old problem?
Some other users encounter the same issue… :thinking:

Hi @100son_net , @euklid , @thomas.kettner ,

This error shows that the token is expired or revoked by Google.

With the status of the being set to “Testing” in Google OAuth Client configuration, Google placed a limitation on token expiry and as per Google it is 7 days and this can be sorted by re-authorizing, it will work only for another 7 days and you may have to follow the same step, it is very inconvenient. You can try to publish the app during configuration instead of Testing and re-upload the new OAuth JSON file in to Matomo and try it again.

I have the same issue. The only difference is that I have the app in production not in test (google cloud API). I get the same error message. Have been getting this for the last three days.
It always stops at the same date , and stops 5-10 minutes after I restart the task everyday.
I have tried reauthorizing and tired recreate the task in matomo. Nothing helps.
Anything else I can try?

I am experiencing the same issue!

@Thomas_Christiansen @felix1
Did you try what Karthik suggested one month ago?

This doesn’t seem to apply for me, since this issue happens since day 1 for me. Re-authorizing earlier doesn’t help either.

(I posted the following message on the related GitHub issue, but am cross-posting here too for good measure …)

For what it’s worth, I’m also getting similar errors with a more current setup:
Matomo 4.13.3
GoogleAnalyticsImporter v4.5.0 (as installed via the Plugin Marketplace)
MySQL version 8.0.28-0ubuntu0.20.04.3
PHP 8.1 FastCGI

As with others on this thread, it’s happening well before 7 days from authentication. Also similarly, if I re-authenticate it seems to temporarily fix the issue but usually only for another short period of time (usually less than a day).