[Google Analytics +] Authorisation error Google Analytics

Im getting the error "Authorisation error." It just won't work. I've tried deleting and reinstalling. Can you help? Access is granted.

  • Dimitris
    • Support Star

    Hello there Mike D

    I trust you're doing good today! :slight_smile:

    I first tried to test this in a site of mine. Here's what I did:
    - added the test site as a new property in Google Analytics (https://support.google.com/analytics/answer/1042508?hl=en)
    - used the login link here:

    - logged in with the same Google Account
    - got the access code and that was it (please keep in mind that you still have to manually add the Site Tracking Code)

    If you do have followed above steps, then this can be some kind of conflict with another plugin. Could you please proceed with a conflict test? First create a recent backup in case you lose any settings during the test and have to restore to a previous working state.
    Then deactivate all plugins and MU-plugins apart from WPMUDEV Dashboard and Google Analytics plugin, activate a default theme like TwentySeventeen, clear all caches and check again if the issue is still there.
    If not, it means that something is conflicting, so start activating the remaining plugins and theme, one by one this time, checking every time for the reported issue, until you reproduce the issue, thus finding the conflicted combination. The following flow chart image can assist you during this test: https://premium.wpmudev.org/wp-content/uploads/2015/09/Support-Process-Support-Process.gif
    If this is a live website with traffic, I'd rather advice to create a staging environment first, meaning a complete and exact copy of this installation into another location/folder in the same server, using a separate database, and perform the test in there instead without worrying about live site.
    Reference: https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-2

    Warm regards,
    Dimitris

  • Nastia
    • Support Rock Star

    Hello Mike D

    Hope you are doing well!

    I've tried to access your site but unfortunately, the access token has expired. Would you please re-vole and re-grant access again?

    The notice shared above should not affect the plugin's functionality.

    On your site, is there any kind of cache active? After you've logged in to Google Analytics, would you please clear site's cache and see if the code is showing in the filed? Do you have a varnish cache enabled on your server?

    Would you please take the Google Analytics code UA-XXXXX-X and add it manually to this field, shown below?

    Let us know how it went!

    Cheers,
    Nastia

  • Mike D
    • The Bug Hunter

    I tried clearing all caches, changing browsers, deactivating all plugins and themes. Its just not working :weary: . Use the staging site if you get a chance to investigate, it is a clone of the current site and has the same issue.

  • Dimitris
    • Support Star

    Hello there Mike D

    I tried to add your staging domain as a new property to my testing Google account and then login with it, but it seems that I'm getting the same issue with you.

    As this isn't reproducible in another testing site of mine, this may be some kind of conflict.
    Is there a backup of this staging environment?
    If so, can I proceed by disabling plugins and using a default theme for testing?
    Please advise!

    Also keep in mind that this connection is used in order to "enable access to network statistics inside WordPress Admin Dashboard.", and not for enabling analytics in your website, in general. This can also happen with the "Site Tracking Code" option, as mentioned by Nastia above, which already works well:

    Warm regards,
    Dimitris

  • Dimitris
    • Support Star

    Hello there Mike D

    It seems that the support access to the staging site has been revoked or expired.
    As you also need a "maintenance mode" in there and in order to be test this safely, could you please share some more access details with me? As this is public forum, you must send us your details through our safe contact form
    https://premium.wpmudev.org/contact/#i-have-a-different-question
    using this template:

    Subject: "Attn: Dimitris"

    - WordPress admin (login url/username/password)
    - FTP credentials (host/username/password/path of site in question)
    - cPanel/Plesk credentials (host/username/password)
    - link back to this thread for reference
    - any other relevant urls

    Keep in mind the subject line as ensures that it gets assigned to me.

    Warm regards,
    Dimitris

  • Dimitris
    • Support Star

    Hello there Mike D

    I've escalated this to our Second Level Support team, as I wasn't able to make any progress using my Google account. :confused:
    We'll further investigate this -I may also miss some setting in my Google account- and keep you posted here as soon as possible! :slight_smile:

    Warm regards,
    Dimitris

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Mike D !

    I've fixed your staging environment, so you should be able to login without issues now.

    For some reason the plugins db table "gaplus_login" was missing from both the live + the staging website. Inside the database there's a meta in the _options table called "gaplus_ver" that is set to 1 so the table doesn't get recreated after the initial setup. Now I'm not sure what might have happened here but since the option is 1 there should've been a table as well. Maybe it got deleted by accident or via a cleaning db plugin?

    In any case the only thing needed to be done is set the "gaplus_ver" option to 0 and deactivate/re-activate the plugin so it will create it's table again to be able to save the logins.

    I can easily do that for you if you like but I'll need you to enable Support Access to your live site as well ( also please make sure to keep a database backup and I'll keep one myself when I proceed with the changes for safekeeping ).

    Tell me if you need further help or want me to fix it for you on the main site!

    Regards,
    Konstantinos

  • Mike D
    • The Bug Hunter

    Thank you very much for that. You can access the live site with the same credentials as the staging. I will also enable access.

    Yes, I used a db optimizing plug-in recently to clean up unused tables, that was before installing GA. But I did have it installed a few years ago so that is probably why the option to setting was still there. Oops! How come that type of error doesn’t show in Debug?

    • Konstantinos Xenos
      • Rubber Duck Debugger

      No problem at all Mike D !

      You should be good to go on the main site as well now so try to Log In in the GA+ plugin.

      Ah then that's why the option was left as 'set up' but with the table missing. As for the debug.log, I'm not sure, there should've been errors in there ( I didn't check to be totally honest I went straight into the database to see what's going on and just found the hiccup ).

      In any case, I guess there's no need for the staging anymore ( at least not for us ) if you want to remove it and tell me if everything is ok on your main site as well!

      Regards,
      Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.