Google Analytics 4 wonn’t connect

#442387
  • Resolved Shahmir Fakhimi
    Rank Math free

    Greetings
    I was trying to change Google Analytics Universal to GA4 but unfortunately after tried to change, Rankmath lost it’s connection with Google Analytics and even i am not able to revert back to the Universal version.
    Please see attached video.
    could you please let me know what I have do to with this matter?

    Thank you in advance

Viewing 14 replies - 1 through 14 (of 14 total)
  • Anas
    Rank Math business

    Hello,

    Thank you for contacting Rank Math, and sorry for any inconvenience caused.

    Please follow these steps:

    1. Log in to your website in an incognito window in Chrome.

    2. Remove the access to Rank Math from your Google account:
    https://myaccount.google.com/permissions?gar=1&pli=1
    remove

    3. Reconnect with your Google account, give all the permissions and configure the settings.

    Let us know how it goes.

    We look forward to helping you.

    Greetings
    Many thanks for your kind response.
    Actually before opening the support ticket, I’ve tried all the steps which recommended on previous support tickets at the rank math forum.

    Also I have tried to remove the rank math permission from google account and I did tried many times to reconnect to the google analytics but obviously it’s not working!

    please note that even i am not able to switch back to the universal version as i sent the video in my previous message it doesn’t appear to the rank match panel anymore.

    Please advice.

    Regards

    Nigel
    Rank Math business

    Hello,

    We might need to take a closer look at the settings. Please edit the first post on this ticket and include your WordPress & FTP logins in the designated Sensitive Data section. Please also add our developer as a user to your Google Analytics account: k*******@r***********

    Please do take a complete backup of your website before sharing the information with us.
    Sensitive Data Section

    It is completely secure and only our support staff has access to that section. If you want, you can use the below plugin to generate a temporary login URL to your website and share that with us instead:

    https://wordpress.org/plugins/temporary-login-without-password/

    You can use the above plugin in conjunction with the WP Security Audit Log to monitor what changes our staff might make on your website (if any):

    https://wordpress.org/plugins/wp-security-audit-log/

    We really look forward to helping you.

    Hello,

    I have updated the sensitive data as requested. Can you please check further?

    Thank you.

    Greetings
    Many thanks for your kind response.
    I have shared the login access to the host and wp on our test server.

    Kindly please bear in mind this server is located in Iran which is with Iran IP, as i have test on our other servers such as US and Germany there is no problem with rankmath. but seems 2-3 days ago we’ve face the problem with our servers in Iran.

    Please note that i have tried to access google analytics via another plugins,and there is no problem with it and host successfully connected to google analytics.

    All the best.

    Hello,

    I have logged in to your site to take a look at this issue, and while I can see some errors in both the server’s error log and the browser’s JS console, I cannot pinpoint the issue to a specific error.

    I have made a small change in one of the plugin files, to make Rank Math insert some additional details in the error log whenever the Google connection fails. Please navigate to Rank Math > General Settings > Analytics, and try to disconnect and then reconnect with your Google account one more time. Once done, please leave a reply here, and we will log in to your site one more time to check those details in the error log. Hopefully, that will give us some information about the issue, and we can suggest a solution for it.

    Thank you. Looking forward to your reply.

    Greetings
    Many thanks for your reply.
    Feel free to make any change as it’s a developer test server.
    I reconnect reconnect rankmath to the google account again.
    Still it’s not working.

    thanks

    Hello,

    I checked the logs on your site, and the data I wanted to log is present in it, but it does not help with our issue, unfortunately. The response your site receives from Google’s API looks correct. One thing I noticed is that the response with the list of sites does not include this site, as if this site was not added as a property on Search Console & Analytics. If this is the case, please try adding the site as a property on both services.

    Now I have made some changes in the code, to capture different pieces of data from Google’s API. Please try reconnecting again (after making sure the properties exist in Google’s services), and let’s see if this time we get any useful information from the logs.

    Thank you. Looking forward to your reply.

    Dear Balazs
    Many thanks for your kind response.
    I have added this site to the property for your reference, but I don’t think this cause because of the matter, As i checked with in other host as well even not able to see universal properties on the list and also the websites is not appears on the search console list.

    according to your investigation, do you think if it’s a network issue?

    Thank you in advance.

    Hello,

    Right now the response your server receives from Google’s API is not correct: the request is declined because the access token is expired or invalid for some reason. This can happen for various reasons, and maybe it is not even related to the original issue. In any case, right now I can’t do anything on your site until it is reconnected with the Google account.

    If it’s possible, please add my account as an administrator on Search Console & Analytics, so that I can troubleshoot the issue on your site: b*******@r***********

    Thank you. Looking forward to your reply.

    Hello
    I’ve added your account as administrator to google analytics and also I reconnected google analytics.

    All the best

    Hello,

    I have further investigated the issue, and from what I see, it is indeed happening because of the server location (Iran). When we make a request from your server to any of the https://www.googleapis.com/ API URLs, we get a response like this: "response":{"code":403,"message":"Forbidden"}. The same request can be made without any issue from a different server, and we get the correct response.

    Only that specific domain seems to be affected. Rank Math also uses https://oauth2.googleapis.com and https://analyticsadmin.googleapis.com to fetch some of the data, and these URLs can be accessed correctly from your server.

    I can suggest you the following things:

    A. Migrate your site to a server in a different location.
    B. Set up proxying for the external requests, either on the server-level, or inside WordPress.

    Hope that helps.

    Greetings
    Many thanks for your kind response, Actually I was mentioned earlier in this topics, that we have this issue only with our servers in Iran.

    Kindly please note that the other domain has the similar problem too, but as i inserted Google tag manually, that’s why they are working now.

    SO in this matter I think I have no other choice to disable analytics module from RankMatch and just simply add google tag in <head>. because as i tried to use proxy for external request it’s really affected to site performance as well.

    Best Regards.

    Hello,

    Unfortunately, there is not much we can do in this situation. Until Google stops blocking Iranian IPs from accessing the API endpoint, the Analytics module will not work correctly on your site.

    I have to add that normally, setting up a proxy for the external requests on your server should not slow it down significantly, but it depends on what themes/plugins you use, and of course on the speed of your server and the proxy.

    You might want to try connecting your site from time to time, as the blocking may be temporary.

    If you need help with anything else, please feel free to open a new ticket.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 14 replies - 1 through 14 (of 14 total)

The ticket ‘Google Analytics 4 wonn’t connect’ is closed to new replies.