Title: google_api_connection_fail when activating plugin
Last modified: October 31, 2023

---

# google_api_connection_fail when activating plugin

 *  Resolved [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/)
 * Re: I am a amateur at this!
 * The message I get when I try to activate sitekit is:
 * “Your site may not be ready for Site Kit
 * Looks like your site is having a technical issue with requesting data from Google
   services.
   To get more help, ask a question on our [support forum](https://wordpress.org/support/plugin/google-site-kit/)
   and include the text of the original error message:google_api_connection_fail”
 * When I click signin “[https://staging.therockiestours.ca/therockiestours.ca/wp-admin/index.php?action=googlesitekit_proxy_setup_start&nonce=bbb3592ead&#8221](https://staging.therockiestours.ca/therockiestours.ca/wp-admin/index.php?action=googlesitekit_proxy_setup_start&nonce=bbb3592ead&#8221);
   I get:
 * “The request to the authentication proxy has failed with an error: request_failed
   [Get help](https://sitekit.withgoogle.com/support?error_id=request_to_auth_proxy_failed).”
 * When check curl I get
 * [root@vps197 ~]# curl -I [https://sitekit.withgoogle.com](https://sitekit.withgoogle.com/)
   
   HTTP/2 403alt-svc: h3=”:443″; ma=2592000,h3-29=”:443″; ma=2592000
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fgoogle_api_connection_fail-when-activating-plugin-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 31 total)

1 [2](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/page/2/?output_format=md)

 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165039)
 * Please note this was working on my other sites on the server previously, but 
   now I am getting json errors on those other sites now, not sure if related
 * “Unknown Error (code: Invalid JSON response). [Get help](https://sitekit.withgoogle.com/support?error_id=Invalid%20JSON%20response)“
 * “Data error in Analytics Invalid JSON response”
 * “Data error in Search Console Invalid JSON response”
 * Also I have tried already resetting site kit in Tool/Available Tools
    -  This reply was modified 2 years, 7 months ago by [ochoppee](https://wordpress.org/support/users/ochoppee/).
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165056)
 * I have submitted my health information here
 * [https://docs.google.com/forms/d/1lhjns2K7c0Ny7ME4gxTcsnYtNUtcMr8BvFpPQi23Y1E/](https://docs.google.com/forms/d/1lhjns2K7c0Ny7ME4gxTcsnYtNUtcMr8BvFpPQi23Y1E/)
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165061)
 * Please note: **[https://staging.therockiestours.ca/therockiestours.ca/](https://staging.therockiestours.ca/therockiestours.ca/)
   and [https://therockiestours.ca/](https://therockiestours.ca/)** are having the
   same issue
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165070)
 * Thanks for reaching out, and sharing your Site Health information along with 
   your cURL checks. Based on the information provided, I suspect there is something
   at host level blocking communication between your site and the Site Kit service(
   sitekit.withgoogle.com). This could be only if communicated over IPv6 as per 
   other users experience. To determine more on this, please share the following:
    1. Do you see any warnings or errors when checking your Site Health status ([_Tools > Site Health > Status_](https://i.imgur.com/wSRWwon.png)),
       which differs from your Site Health information previously shared?
    2. If you perform the following command – which will ensure communication is over
       IPv4 only, do you encounter a successful 200 response? `curl -4 -I https://sitekit.
       withgoogle.com`
    3. Does the same occur if you temporary disable any Web Application Firewall?
 * Let me know if you have any questions with the above. Note also you can rule 
   out the issue being anything local or with your browser by checking does the 
   same occur on [this demo WordPress site](https://tastewp.org/plugins/google-site-kit/).
   I suspect you will be able to complete set up without issue.
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165085)
 * Hi
 * Regarding Site Health
 * No the only warning I have is below, I have eliminated the rest of the errors
   previously, and this occurred after I moved the site off cloudflare nameservers
   to my domain and hosting provider Canspace
 * “Unable to detect the presence of page cache Performance
 * Unable to detect page cache due to possible loopback request problem. Please 
   verify that the loopback request test is passing. Error: cURL error 28: Operation
   timed out after 5001 milliseconds with 0 bytes received (Code: http_request_failed)
 * Page cache enhances the speed and performance of your site by saving and serving
   static pages instead of calling for a page every time a user visits.
 * Page cache is detected by looking for an active page cache plugin as well as 
   making three requests to the homepage and looking for one or more of the following
   HTTP client caching response headers:`cache-control`, `expires`, `age`, `last-
   modified`, `etag`, `x-cache-enabled`, `x-cache-disabled`, `x-srcache-store-status`,`
   x-srcache-fetch-status.`
 * [Learn more about page cache(opens in a new tab)](https://wordpress.org/documentation/article/optimization/#Caching)“
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165102)
 * Re: Demo Site and Web Application Firewall and curl
 * The Demo site works for me with my chrome browser! I might note that I use Immunify360,
   does this info help, and I am checking on curl
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165124)
 * Re: Curl ipv4
 * [root@vps197 ~]# curl -4 -I [https://sitekit.withgoogle.com](https://sitekit.withgoogle.com/)
   
   HTTP/2 200content-type: text/htmlvary: Accept-Encodingx-cloud-trace-context: 
   f040e5ffe9635f82a4d6deccf648c78bdate: Tue, 31 Oct 2023 18:39:15 GMTserver: Google
   Frontendalt-svc: h3=”:443″; ma=2592000,h3-29=”:443″; ma=2592000
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165129)
 * Additional Info Curl
 * In regard to the response you posted, while the server does have an assigned 
   IPV6 address it uses IPV4 for it’s main connection. The curl command defaults
   to IPV6 without the -4 flag they mention in the response. The output of the updated
   command is pasted for you below and does give a successful 200 connection code.
 * Your server does have a WAF in place (mod security) which can be disabled for
   testing (or completely) within cPanel in the security section under Mod Security.
   You can disable this for any specific site within the account.
 * [root@vps197 ~]# curl -4 -I [https://sitekit.withgoogle.com](https://sitekit.withgoogle.com/)
   
   HTTP/2 200content-type: text/htmlvary: Accept-Encodingx-cloud-trace-context: 
   f040e5ffe9635f82a4d6deccf648c78bdate: Tue, 31 Oct 2023 18:39:15 GMTserver: Google
   Frontendalt-svc: h3=”:443″; ma=2592000,h3-29=”:443″; ma=2592000
 * -Guy H.
   Support, CanSpace
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 7 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17165131)
 * Re: Immunify360
 * I have disabled immunify360 for the site right now, and still have the issue 
   as stated in the topic
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17166401)
 * Thanks for the troubleshooting updates [@ochoppee](https://wordpress.org/support/users/ochoppee/),
   which confirm that the issue is specific to IPv6. I’m happy to request a check
   for any blocks if you can share the following:
    1. Your IPv6 address for the impacted sites. I suspect they are all within the 
       same range.
    2. Are you using a shared hosting solution? If not have you tried restarting your
       server? I ask as I noticed some cURL errors reported in your Site Health status.
       With that may also wish to temporarily switch PHP version.
    3. Did you have Site Kit successfully running on any of these sites before?
 * Let me know if you have any questions with the above.
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17166718)
 * Hello,
    1. Your IPv6 address for the impacted sites. I suspect they are all within the 
       same range.
 * Yes, I believe they are as they are hosted on a VPS, which has 2 IP’s assigned
   to it.
    1. Are you using a shared hosting solution? If not have you tried restarting your
       server? I ask as I noticed some cURL errors reported in your Site Health status.
       With that may also wish to temporarily switch PHP version. 
 * No I have not tried restarting the server, I can ask my hosting provider to do
   so. Due to complex issues, switch PHP versions is not an easy task, as it may
   affect each site differently that is hosted on the server, I can do this as a
   last resort?
    1. Did you have Site Kit successfully running on any of these sites before?
 * Yes I did on all my sites on the server, the other sites are either still connected
   and experiencing json error when trying to retrieve data or having issues connecting.
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17167649)
 * So if IPv4 works and IPv6 is forbidden, what might be a solution?
 *  Plugin Support [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * (@jamesosborne)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17167730)
 * If you want to share the IPv6 addresses for your site/sites then I can check 
   if there is a block.
 * > No I have not tried restarting the server, I can ask my hosting provider to
   > do so. Due to complex issues, switch PHP versions is not an easy task, as it
   > may affect each site differently that is hosted on the server, I can do this
   > as a last resort?
 * There is no guarantee that a restart will address the issue. If it’s related 
   to an IPv6 block then it likely won’t correct the issue, so don’t worry about
   restarting if it’s not a straightforward task. I’ll request a check of your IPv6
   address first.
 * > So if IPv4 works and IPv6 is forbidden, what might be a solution?
 * Great question. If we can determine an IPv6 block based on the range, then this
   can be addressed at host level. One workaround is to temporarily disable IPv6
   when setting up Site Kit. If you have web terminal access I can provide you with
   the steps to do so. Otherwise, let me know of the IPv6 address of your host server
   and I’ll request a check for any block.
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17167824)
 * Here is my hosting provider response, and I had them restart the server.
 * Posted by **CanSpace Solutions G1** on 1st Nov 2023 (09:26)**Operator**
 * Hello Peter,
 * The IPV6 address assigned to your server is noted below. If you’d like a restart
   of the server we can take care of that for you as it is your private VPS as opposed
   to a shared host.
 * inet6 2607:5300:201:3100::82c1 prefixlen 64 scopeid 0x0<global>
 * -Guy H.
   Support, CanSpace
 *  Thread Starter [ochoppee](https://wordpress.org/support/users/ochoppee/)
 * (@ochoppee)
 * [2 years, 6 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/#post-17167830)
 * “One workaround is to temporarily disable IPv6 when setting up Site Kit. If you
   have web terminal access I can provide you with the steps to do so.”
 * Let me know if I need this after you check my IPv6 for a block! If so I can work
   with my hosting provider on this.
    -  This reply was modified 2 years, 6 months ago by [ochoppee](https://wordpress.org/support/users/ochoppee/).

Viewing 15 replies - 1 through 15 (of 31 total)

1 [2](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/page/2/?output_format=md)

The topic ‘google_api_connection_fail when activating plugin’ is closed to new replies.

 * ![](https://ps.w.org/google-site-kit/assets/icon-256x256.png?rev=3141863)
 * [Site Kit by Google - Analytics, Search Console, AdSense, Speed](https://wordpress.org/plugins/google-site-kit/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/google-site-kit/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/google-site-kit/)
 * [Active Topics](https://wordpress.org/support/plugin/google-site-kit/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/google-site-kit/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/google-site-kit/reviews/)

 * 31 replies
 * 3 participants
 * Last reply from: [James Osborne](https://wordpress.org/support/users/jamesosborne/)
 * Last activity: [2 years, 5 months ago](https://wordpress.org/support/topic/google_api_connection_fail-when-activating-plugin-2/page/3/#post-17305275)
 * Status: resolved