site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Analytics module fails set up flow

Open amedina opened this issue 7 years ago • 10 comments

Describe the bug The flow for setting the Analytics module fails to complete with a blank screen. To Reproduce Steps to reproduce the behavior:

  1. Activate Analytics module

Expected behavior Displaying analytics properties selection Screen Shot 2019-06-20 at 4 27 36 PM

System Information (please complete the following information):

  • Browser: Chrome
  • Plugin Version: beta1

Do not alter or remove anything below. The following sections will be managed by moderators only.

Changelog entry

  • Fix analytics setup flow empty render for accounts with only shared properties or views.

Acceptance criteria

amedina avatar Jun 20 '19 14:06 amedina

I'm having the same issue #3

eduardogoncalves avatar Jun 20 '19 14:06 eduardogoncalves

@amedina the blocked script execution is expected behaviour, an iframe is used to check existing Analytics and AdSense tags from the front end and prevent scripts from running. It is planned to improve this in the future.

I am not able to reproduce the issue described. Can you provide information of the response to the request made to get-accounts in of the console > Network > filter with XHR only? Also, please make sure to clear sessionStorage before refreshing the page to make the request. Thanks!

lucymtc avatar Jun 21 '19 13:06 lucymtc

Same here, tried in both firefox and Chrome. Neither will connect. Even deleted and tried readding it and it never connects to Google Analytics.

forcedlogic avatar Jun 21 '19 16:06 forcedlogic

Hello, same here: Analytics not showing after connecting to analytics account /trying to set up modules in the Site Kit > Analytics Dashboard. Error message from chrome browser:

Blocked script execution in '' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.

Search console works ok, but there is a Data error in Search Console Rate Limit Exceeded in some cases.

PhotoWorkout-archive avatar Jun 22 '19 20:06 PhotoWorkout-archive

@amedina @eduardogoncalves @forcedlogic @PhotoWorkout The temporary fix for this seems to add the analytics tracking code in the website header. If it can find the analytics tracking code it shows it and tells that it will be replaced if you remove the old code. Just don't remove it and continue.

FuSan21 avatar Jun 23 '19 01:06 FuSan21

Putting the analytics tracking code in the header worked fine to set up the site kit analytics module. I have thereafter removed the code from the website header again since I am using google tag manager for injecting the tracking code. The Site Kit seems to work fine after removing the analytics code from the header. I assume it was just needed (once) for the initial activation, which worked just fine. Thanks

PhotoWorkout-archive avatar Jun 23 '19 12:06 PhotoWorkout-archive

Putting the analytics tracking code in the header worked fine to set up the site kit analytics module. I have thereafter removed the code from the website header again since I am using google tag manager for injecting the tracking code. The Site Kit seems to work fine after removing the analytics code from the header. I assume it was just needed (once) for the initial activation, which worked just fine. Thanks

Yeah it keeps the sitekit plugin activated alreight. But it doesn't fix the issue. If you remove the tracking code you won't be able to track any future visitors and only see old data in sitekit plugin.

FuSan21 avatar Jun 23 '19 13:06 FuSan21

Thanks for letting me know about tracking future events (and that the tracking code needs to be in the header for that to happen). I have moved it back into the header and removed it from the tag manager. It seems all to work fine, I just had to add my Content Groups via the tracking code (which was configured with the Google Tag manager before).

PhotoWorkout-archive avatar Jun 23 '19 15:06 PhotoWorkout-archive

Hi, I have tested across different sites and still unable to reproduce, in order to help debug, can you provide:

List of other installed plugins PHP version WordPress version

Also can you verify the request to get-accounts is made in the Network tab of the console? if so, can you provide information of the response to this request? if there are any errors and the error message. Thanks!

lucymtc avatar Jun 24 '19 09:06 lucymtc

@lucymtc I can reproduce this issue and did trace it to these lines: https://github.com/google/site-kit-wp/blob/develop/assets/js/modules/analytics/setup.js#L796-L798 that's causing the blank dropdown.

To reproduce:

  1. Authenticate Site Kit with Google Accounts that has only 1 GA account
  2. Activate GA service.

Consider to simplified these code blocks: https://github.com/google/site-kit-wp/blob/develop/assets/js/modules/analytics/setup.js#L791-L814 and add more inline comments.

ivankristianto avatar Jun 24 '19 18:06 ivankristianto