Support » Plugin: Site Kit by Google - Analytics, Search Console, AdSense, Speed » Plugin setup stuck in a loop (without any error notice)

  • Bug Description
    SiteKit can’t complete setup because it’s continuously redirects to the splash page after the OAuth2 flow, without any error or warning (see gif).

    Steps to reproduce
    Go to WP-Admin > SiteKit > Dashboard
    Click on “Start Setup”
    Complete the OAuth2 connection flow
    The sitekit’s website redirects to the WP site to confirm the setup, but WP redirects back to the sitekit’s splash page.

    Additional Context
    PHP Version: 7.3
    OS: MS Windows 10
    Browser: Chrome
    Plugin Version: 1.9.0
    Device: PC
    Server: Google App Engine
    Multisite: yes (occurred in single sites too)

    We used sitekit on different sites and in some of them it completed the setup correctly. The all are based on the same environment. I’ve tried changing Google Account, Incognito Mode, Resetting the plugin but nothing has worked so far.

    I suppose that there is something that fails in the connection but the plugin gives no feedback about the error and simply redirects back to the Oauth flow. An error before the redirect could help a lot.

    I can’t debug on the live sites because I’m running WP on AppEngine and I have no shell access.

    The domain was already verified in the Search Console as it’s required to verify it to use with Google App Engine.

    Thanks for the support.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter Brando Meniconi


    I’ve already sent the Site Health info via the form.

    Plugin Support James Osborne


    @brandomeniconi Thanks for getting in touch, and providing the additional information. From checking your site details it looks like you have your WordPress files in a /wp directory. Because of this Site Kit may be redirecting back to an incorrect root URL.

    When setting up your site did you follow the steps on this guide to place your site in a subfolder?

    Thread Starter Brando Meniconi


    Sorry for the delay and thanks for further analysis. I try to give more context:

    We are managing WP via composer to reduce deploy payloads and let App Engine figure out the WP-code download during build. So the WP-core is under the /wp folder but the site loads form /. Also the plugins folder is under /app/plugins/instead of /wp-content/plugins. More info on file structure here: roots/bedrock

    We have used this env for more than 100 sites with no problem as it uses WP native constants to set up correct paths. Most of well designed plugins works with no fuss. As I also mentioned in many sites with the same setup, the SiteKit plugin work flawlessly. So I don’t know if the problem could be there.

    So I think that the error resides something else, maybe because we install our sites on a staging domain and than switch to the real domain when it’s done?

    Yere you can find the URL redirect chain: IMAGE, the return url
    is correct and the response has the X-Redirected-By: WordPress header.

    I’ve inspected the SiteKit plugin code: seems that if WP fails to authenticate to SiteKit it blindly redirects to OAuth flow, maybe assuming that some scopes are missing or revoked. To let the user better troubleshoot I suggest adding an error notice and a retry button..

    The reason why the auth if failing is still unknown to me.

    Plugin Support Renee Johnson


    @brandomeniconi thanks so much for these details. Your issue sounds very similar to this one we are investigating regarding the Bedrock setup:

    One user also reported the same regarding sites working fine with the Site Kit setup, while another doesn’t.

    So I think that the error resides something else, maybe because we install our sites on a staging domain and than switch to the real domain when it’s done?

    – This might be something. Could you confirm if the sites where Site Kit is working also were on a staging domain at some point?

    – Are the other sites also sub-sites of a multisite network?

    I’ll add your topic to the issue to help aid in the investigation. Thank you!

    Thread Starter Brando Meniconi


    Hi Renee, thank you for pointing that out, I’ll follow it!

    – Regarding the staging domain, yes we use staging domain for all our sites and many of them are working fine with SiteKit. A variable could be when the SiteKit plugin has been activated for the first time. Usually we keep it disabled until the site is moved to the final domain, but could’ve happened that in some cases it has been activated while still on the staging domain.

    – I’ve another multisite with the same setup (bedrock+gae) where SiteKit working fine for all sub-sites. The same bug is occurring on non-multisite sites.

    I you want I can send you the domains for each case and give temporary access to those sites.

    Plugin Support Renee Johnson


    @brandomeniconi thanks for the details!

    While we’re not allowed access to sites, it would be great to get Site Health info for a few of your setups to compare:

    1) multisite sub-site without the issue (is there one that works within the same network of the sub-site that has the issue?)

    2) non-multisite site with the issue

    You can send them through this form as you have done before.

    A few additional questions:

    1) are you using the same Google Account to sign in for all of the sites?
    2) approximately how many sites have you been able to setup Site Kit?

    Many thanks for the troubleshooting help!

    Thread Starter Brando Meniconi


    Hi @reneesoffice,

    I’ve sent you the requested SiteHealts right now. If you need more please let me know..

    1) If a multisite works, in my case it works for all the sites. If not, all the sub-sites don’t work. The one I sent that is working has a dedicated domain for each site (.it/.com/.de) while the one that I sent with the first post uses third-level domains (,, etc)

    2) I’ve sent a single site that isn’t working, a strange fact is that when I tried today to connect the first time I received the WP error notice:
    Unknown Error (code: getting user ID failed). To resume setup, start here.
    I tried again and the Oauth loop started again.

    3) Yes I’m using the same Google Account for all the sites, is also the WP administrator.

    4) I’ve been able to setup 4/5 sites with SiteKit. I’ve many more to setup but I’m waiting for the bug to been solved.

    There is a way to test it in a local environment? Maybe I can trace the code and output the error..


    Plugin Support Renee Johnson


    @brandomeniconi much appreciation for the info and the additional details here! I’ve shared this with the team for further investigation. We’ll follow up with more info or inquiries as we have it. Thanks again for the help with troubleshooting!

    Thread Starter Brando Meniconi


    Hi, any new updates on this?

    Today I’ve setup a fresh site and on first try it gave me this error:

    Unable to authenticate Site Kit, as no client credentials exist. To resume setup, start here.

    than started the looping again..

    Plugin Support Renee Johnson


    @brandomeniconi thanks so much for your patience as we continue to troubleshoot.

    Let’s see if we can find a pattern. Is this site:

    1) part of multisite network or a single site?
    2) was it also on a staging domain before moving it to production?
    3) configured with Site Kit before moving to production or after?

    Thanks again @brandomeniconi !

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Plugin setup stuck in a loop (without any error notice)’ is closed to new replies.