• Resolved ljmac

    (@ljmac)


    Hi,

    When I try to authorise your plug by the normal method, I get this API error:

    The SSL certificate for the host could not be verified.

    I don’t know why this is – I am using Cloudflare with one of their origin certificates on my server, in strict mode with authenticated origin pulls enabled.

    So I tried the developer method. I put in my site’s home page as the redirect URL, but when I try to activate this way, I get the following error:

    Error 400: redirect_uri_mismatch

    So what URI should I be using?

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Alin Marcu

    (@deconf)

    Hi,

    The redirect_uri is:

    https://yourdomain.com/wp-admin/admin.php?page=aiwp_settings

    Please replace yourdomain.com with your domain name on the above URI.

    Please note that if your API project has the Publishing status set as Testing your refresh token wil expire after 7 days. It must be set to In Production. This option can be found on Oauth2 consent screen, but to set it for production there are a few checks including a manual Google check that you’ll have to comply with.

    Thread Starter ljmac

    (@ljmac)

    Thank you so much for the fast response! Do you have any idea what might be causing the SSL error when trying to authorise in the normal way?

    Plugin Author Alin Marcu

    (@deconf)

    Hi,

    Have you enabled Debugging to check the exact line where the error is thrown?

    Also if you’re using a custom CA bundle, you should make sure is loaded by WordPress (wp-includes\certificates), you can find some solutions here.

    From your original post I understand that you are running WordPress on your own server (not with a hosting company), right?

    Thread Starter ljmac

    (@ljmac)

    I am on a VPS, which I set up myself, although it is with a hosting company. The Cloudflare cert is officially signed, not self signed.

    I did mange to get the plugin fully authorised with the right redirect uri, but a soon as I went to the Dashboard I got a 403 error, then when I went back to your plugin I found it had become de-authorised with the following error:

    API Error Reason: Google Analytics Data API has not been used in project [number] before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/analyticsdata.googleapis.com/overview?project=%5Bnumber%5D then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.API Error Details: Array ( [0] => PERMISSION_DENIED [1] => trying to refresh token )

    Plugin Author Alin Marcu

    (@deconf)

    You need to enable Google Analytics Data API and Google Analytics Admin API.

    Thread Starter ljmac

    (@ljmac)

    I already had those two enabled – I found I had to also enable the ‘Google Analytics API’ – now it’s finally working!

    So your plug in doesn’t have the real time view any more?

    • This reply was modified 8 months ago by ljmac.
    Plugin Author Alin Marcu

    (@deconf)

    For that there’s a checkbox that needs to be enabled under Backend Settings. If you enable it and don’t have access to Real-time API will throw an error. On GA4 I think that access is implicit, no special access needed. Check it out and let me know.

    Thread Starter ljmac

    (@ljmac)

    I tried switching that on but it switched itself back off as soon as I left the screen, yet there was no error message or report.

    Plugin Author Alin Marcu

    (@deconf)

    That’s bug then, I will have a look and fix it on next release. I wonder why the units test haven’t failed, but I’ll double check it

    Thread Starter ljmac

    (@ljmac)

    I looked up the Real-Time Reporting API, and it said the following:

    This API is deprecated and does not support Google Analytics 4 (GA4) properties. Use the Data API to access the reporting features for GA4 properties.

    Yet I already have the data API. Perhaps your plugin needs to be updated for the new API.

    • This reply was modified 8 months ago by ljmac.
    Plugin Author Alin Marcu

    (@deconf)

    I’ve just test it and the option saves properly (you must use the Save changes button) and the Real-Time reports works fine, without any additional APIs enabled.

    I had a tutorial saved as draft for months (didn’t had time to review it), It’s now reviewed and published, you may have a look at it too. Please make sure you haven’t missed a step.

    Thread Starter ljmac

    (@ljmac)

    Oh my goodness, stupid me: I forgot the save changes button!

    It might be a good idea to get rid of the out of date reference to the Real-Time Reporting API though.

    Thank you so much for your very prompt and thorough help!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Unable to Authorise by Either Method’ is closed to new replies.