I Can't Authorise Google Analytics in Sub-Sites

Hi there,

I'm trying to authorise Google Analytics from within a sub-site (that has a mapped domain) but every time I try, Google asks to allow access to my primary domain (ThinkBiGSites.co.uk) rather than the sub-domain (TheOutsourcedFinanceDirector.com) and, as my primary domain's already got access, when I click to 'Allow' access, I simply get re-directed from the Google authorisation page to my primary home page, without being provided with an authorisation code.

This means I'm unable to select the appropriate analytics property in the sub-site as there isn't a drop down list of properties that are avaiable.

If I try to add the property analytics code manually, Google Analytics+ seems to ignore the code and simply continue to use the primary code for the network and show site data based on that.

This used to work without any issue and I have other domains that are still showing their own analytics code and data within the sub-site dashboard. However, I can't seem to get authorisation for this particular sub-site - and I believe I've had this issue before but didn't raise a ticket at the time.

For some time, now, I've been having problems with your Domain Mapping plugin and I can't help but think that the two issues may be connected because the Domain Mapping issues have included sites being accessible via both the mapped domain and the original domain, despite the fact that I've set it to only allow the mapped domain.

This has never been fixed - I just found a work around (I use the native WordPress Domain Mapping to change the url of the sub-site in the settings).

I may be wrong but this just 'feels' like it's connected.

Kindest regards,

Steve

  • Kasia Swiderska

    Hello Steve,

    I'm sorry to hear this is not working correctly on your site.

    (TheOutsourcedFinanceDirector.com) and, as my primary domain's already got access, when I click to 'Allow' access, I simply get re-directed from the Google authorisation page to my primary home page, without being provided with an authorisation code.

    I can see this issue on your site, however when I replicate the same settings (latest Domain Mapping and also used with it a native WordPress mapping way) on my site I was not able to recreate this issue.
    On subsite with mapped domain I was able to get the access code and there was no redirects to main site like it happens on your site.
    It is very possible it is caused by something other than Domain Mapping on your site.

    I would like to see if there is anything in debug.log after trying to login to Google account. Please enable debug mode: open your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
    define('WP_DEBUG', true);
    In order to enable the error logging to a file on the server you need to add yet one more similar line:

    define( 'WP_DEBUG_LOG', true );

    In this case the errors will be saved to a debug.log log file inside the /wp-content/directory.

    Depending on whether you want your errors to be only logged or also displayed on the screen you should also have this line there, immediately after the line mentioned above:

    define( 'WP_DEBUG_DISPLAY', false );

    The wp-config.php is located in your WordPress root directory. It’s the same file where the database configuration settings are. You will have to access it by FTP or SFTP in order to edit it.

    When its enabled please try logging again to get the issue with redirect.

    I would need then to see content of the debug.log file - so please upload it to service like a Dropbox and paste link here.

    If I try to add the property analytics code manually, Google Analytics+ seems to ignore the code and simply continue to use the primary code for the network and show site data based on that.

    I have checked source of the site and I can see that both codes: network and the subsite one is added there correctly.
    Where do you see network data for that subsite - in Google Analytics? Because I checked Statistics in Dashboard for this site and it only shows data for this particular subsite, not for the network.

    kind regards,
    Kasia

  • Steve - Just Think BiG

    Hi Kasia,

    I've activated the debug log as per your instructions and have tried to verify Google Analytics on several occasions, so, you should see the problem in the log.

    I've activated FTP temporarily for another issue (see here) and I've added the access details to the notes section where I've extended the support access.

    If you need anything else, please let me know.

    Kindest regards,

    Steve

  • Kasia Swiderska

    Hello Steve,

    Debug.log was there, but nothing was generated for this particular action - to be sure I forced creation new file and run google authorization twice and new debug.log was not created.
    I spoke with developer about this problem and they think it might be related to cookies, however they need to take a closer look on what is happening there.
    For the time they will be checking can you keep the FTP account active? As soon they will be any feedback about this issue they will reply here.

    kind regards,
    Kasia

  • Kasia Swiderska

    Hello Steve,

    Oh, I got info about workaround that should allow you to login to the google account on that subsite. I just tested it on my account and it worked.
    When after clicking that button and when page does the redirect to main site, replace domain to subsite domain (but leave everything that is after the domain) and then hit enter.
    It should redirect to GA settings page on subsite and you should be logged in and able to select code for analytics from dropdown.
    Let me know if this will work also for you.

    kind regards,
    Kasia

  • Konstantinos Xenos

    Hi Steve - Just Think BiG ,

    Unfortunately on all my tests I couldn't replicate the issue still at all.

    The only difference between my various setups that I've tested and your setup is that I'm not using any extra protection ( wordfence, firewall etc ) and all of the Domain Mapping checks are Valid. I checked multiple of your subsites and the mapping Health Status always returns invalid. This means that the plugin couldn't reach the domain properly even though it mapped it ( as there is an option in the settings that you can make the bind ignoring the check status ).

    Might there be an issue with the how the DNS propagates or something like that ? Unfortunately I can only speculate at this point, since I don't have any other clues of what might be actually going wrong here as there's no other errors ( at least not code-wise ).

    Best regards,
    Konstantinos

  • Steve - Just Think BiG

    Hi Kasia,

    Domain Mapping used to work perfectly until I reported the problem to you - which was a while ago now. Also, I never had the problem with Google Analytics until recently, either.

    This appears to suggest that something's changed after an update, at some point.

    Given that you can't reproduce the problem at your end, I am wondering whether there's something amiss with my installation.

    I've been thinking about this and there are two specific events that come to mind.

    1) I remember having a problem with the site and I ended up restoring it using a managed backup from the hub. When I restored it, there was an error message, which concerned me at the time. However, when I checked the site, everything seemed to work as it had done before, without any issue.

    2) I moved my hosting from one provider to another. My new provider imported the site from the old host as part of their sign-up offering and one consequence of that is that there are a number of files on the server that I don't see when I install new sites. I also had a problem in that the file manager on that install has restricted privileges and i can't delete certain files myself.

    Anyway, as a result of the above, I wonder whether there may be some kind of issue/conflict that's occurred as a result of one of these events - or the combination of them.

    I've recently set up a completely new multisite install, which I'm going to use for my own sites. I've migrated one across but have a few more to migrate.

    My instinct is not to use a snapshot to move the site but to manually move them i.e copy and paste. Fortunately, the sites aren't too big but I'm keen to have the new install completely independent from anything on the old install.

    This will allow me to test issues happening on the old install to see whether the new install suffers the same problems.

    Anyway, it's just a thought but I'm keen to see if it works.

    Regards,

    Steve

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.