• Resolved torchy23

    (@torchy23)


    Hi support team!

    From WordPress admin while in incognito mode in Chrome, I’ve tried to setup and reset the Site Kit plugin several times but I keep getting this same error when trying to connect to the Google Analytics module.

    “Error: The response is not a valid JSON response.”

    Screenshot: https://drive.google.com/file/d/1CL9NgMJKoX8YzrJIu6l1X-S3cXfXGUKH/view?usp=sharing

    From the chrome developer console, I see that this URL results in 403 error at this URL
    /wp-json/google-site-kit/v1/modules/analytics/data/settings?_locale=user

    Everything is using HTTPS and we don’t have any other analytics plugins activated.

    Our web hosting does have a Web Application Firewall, where I have white listed this user agent: Site Kit by Google/1.0

    When going to Site Health, we have 2 recommended improvements: Remove inactive plugins and Have a default theme available.

    Worth mentioning is Google Search Console works correctly, it’s only Google Analytics we’re having the issue with.

    Appreciate your support, thank you!

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Support James Osborne

    (@jamesosborne)

    @torchy23 Thanks for reporting, hopefully we can assist. From your settings > general options can you inform me do you have a “Timezone” set? If not please assign a timezone and attempt setup once more. From checking your REST endpoint there is no timezone appearing.

    If that fails, or if you already have a timezone set please share your Site Health information and we can hopefully assist.

    If you prefer to share privately you can use this form.

    Thread Starter torchy23

    (@torchy23)

    Thanks for your prompt response. We do have our timezone set to UTC-5.

    I’ve just shared the Site Health information using the linked form.

    Thanks again for your support!

    @torchy23 thanks for the details! Are you using any firewall features with your security plugin?

    I’m not sure if that was activated when you get the error?

    I also see that you may have the Dev Settings plugin. Do you have that configured additionally? Thanks!

    Thread Starter torchy23

    (@torchy23)

    Hi @reneesoffice

    Our host does provide a firewall feature that that is activated and on those settings I currently have this User Agent Whitelisted: Site Kit by Google/1.0
    but still get the same issue.

    Re the Dev Settings plugin, I did have those saved and for some reason they disappeared when I just checked again. I’ve since added them back, saved, confirmed they did save (refreshed), and then tried to connect to analytics but get the same issue still.

    @torchy23 thanks a bunch for the details.

    1) Could you share which host you’re with?

    2) To confirm, are you using the Dev Settings plugin on a staging site or the production (live) site? Its intent is to be used in a staging environment.

    3) It looks like you’re using a caching plugin on the site. Could you attempt connecting to Analytics while the caching plugin is deactivated?

    Thread Starter torchy23

    (@torchy23)

    Hi Renee,

    1) our host is WPMU DEV – https://premium.wpmudev.org/
    2) we are using Dev Settings plugin on our Production (live) site, should I deactivate this?
    3) I just deactivated our caching plugin and tried again but got the same issue still.

    @torchy23 thanks for the info!

    Yes, if you can try with the Dev Settings plugin deactivated that would be great. This plugin is intended to bring in data from the production site into a staging site.

    Since you’re in production, you should use the core plugin alone. Please reset Site Kit before attempting the connection again.

    Thread Starter torchy23

    (@torchy23)

    Thank you, Renee

    I’ve deactivated the Dev Settings plugin, then I reseted Site Kit and went through the Authorization flow again, but still getting the same original issue with Analytics.

    One thing new to mention, on our Staging, I was able to get the Analytics to connect and work. Everything on our Staging is identical to our Production, minus now the Dev Settings plugin is live on Staging.

    To confirm, in our Production firewall settings, are we whitelisting the correct user agent? We have it set as “Site Kit by Google/1.0”

    @torchy23 thanks for the attempt and follow up!

    I’ll need to confirm with the team, but this user agent may not apply for the service connections (like Analytics). We’ve actually opened a Github issue to track and investigate this further.

    I’m going test at WPMU DEV since there does seem to be similar behavior reported in that environment.

    Is your staging site also hosted there?

    @torchy23 I just tested at WPMU DEV, and it does look like the issue is with the firewall (WAF).

    Using the browser tools Network tab, I see the request is blocked and there are instructions to go to the Hosting Hub to check the WAF logs.

    Per the instructions in the log, you’ll need to whitelist your IP address or disable the rule.

    I whitelisted my IP address to just bypass the block and it worked.

    Could you attempt the same and let me know if you’re successful?

    Thread Starter torchy23

    (@torchy23)

    Hi Renee, that did the trick, thank you!

    To confirm, I whitelisted my own IP and it worked perfectly.

    Thanks again for your support ??

    @torchy23 that’s great to hear! Glad you’re connected now.

    If you have chance, leave a review about your experience with Site Kit.

    I am having the same issue but didn’t worked to me

    Plugin Support James Osborne

    (@jamesosborne)

    @hiraokii If you’d like to open a new support topic as per forum guidelines we’d be happy to assist with your case individually.

    Please include all relevant information to your support topic, including your Site Health Information if relevant. You can also share privately if preferred.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Analytics connection gives “Error: The response is not a valid JSON response.”’ is closed to new replies.