Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Issue accessing data" notice appear when Analytics is added #12

Closed
jamesozzie opened this issue Jun 20, 2019 · 31 comments
Closed

"Issue accessing data" notice appear when Analytics is added #12

jamesozzie opened this issue Jun 20, 2019 · 31 comments
Assignees
Labels
Type: Support Support request

Comments

@jamesozzie
Copy link
Collaborator

jamesozzie commented Jun 20, 2019

Describe the bug
After successfully connecting an Analytics account (using the same Google account OAuth which to verify the setup) an "Issue accessing data" notice appears.

While Analytics reporting in the dashboard is fine there the notice remains and trying to re authenticate your account via the button in the notice doesn't solve the issue, the notice reappears.

To Reproduce
Steps to reproduce the behavior:

  1. Active Site Kit
  2. Settings > Connect more services > Analytics
  3. Complete setup procedure

Expected behavior
Notice should not appear

Screen Shot 2019-06-20 at 3 49 23 PM

System information:

  • PHP Version: 7.2
  • OS: Mac
  • Browser : Chrome
  • Plugin Version: 1.0.0-beta.1
  • Host OS: Linux
  • Additional Plugins: TagDiv Composer

Additional context
Another report of same issue from this issue: #1

Site Kit data module check:
https://github.com/google/site-kit-wp/blob/develop/assets/js/components/data.js#L275-L280
insufficientPermission is because of oauth scopes, which happen in most of the cases.
In this case the insufficientPermission is because user doesn't have access to the Analytics Goals.

Preliminary work here:
https://github.com/google/site-kit-wp/compare/fix/insufficient-permission?expand=1


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

Changelog entry

Acceptance criteria

  • For every user who has successfully set up GA and metrics appear in the main plugin dashboard, no error notices should appear.
  • For users that do not have access to Goals, the goals datablock will show a CTA to request access.

Implementation Brief

  • Remove the insufficientPermission error check from the data module. insufficient scope check already in place elsewhere.

  • Handle insufficientPermission error specifically in AnalyticsDashboardWidgetTopLevel component

    - when the goals data point returns insufficientPermission show a CTA that the user cannot access Goals.

@jamesozzie jamesozzie added the Type: Bug Something isn't working label Jun 20, 2019
@ThierryA ThierryA added the P0 High priority label Jun 20, 2019
@ThierryA ThierryA added this to the Hot Fixes Release milestone Jun 20, 2019
@ivankristianto ivankristianto self-assigned this Jun 21, 2019
@ivankristianto
Copy link
Contributor

@jamesozzie
I'm unable to reproduce this.
But from what I understand that alert is because an insufficientPermissions response from Google Service API.
Can you please capture the response of the rest api in console log?

@jamesozzie
Copy link
Collaborator Author

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

See screenshots below.
Screen Shot 2019-06-21 at 1 11 27 PM

In addition there is an error for this when I open in my Developer Console.
Screen Shot 2019-06-21 at 1 09 18 PM

Both OAuth verification were complete via the same Google account. All other Site Kit on other sites processed fine from the same device and same Google account.

@ivankristianto
Copy link
Contributor

Sorry I wasn't made myself clear.
Can you give screenshot of the console > Network > filter with XHR only, from the Site Kit dashboard instead?
So I know which service API has the insufficient permission.

And that blocked script execution is expected behavior since it's an iframe to check existing analytics/adsense tag from the front end. Although we have a plan to improve that in the future.

I'm more interested with the error you see in your developer console. seems like your GCP project has unknown issue.

I would suggest these following steps:

  1. Reset site kit
  2. Create the GCP project with different Google account, you can use the link from the first screen of the setup page
  3. Do the setup flow again, then activate Analytics

let me know if that works for you or not.

@jamesozzie
Copy link
Collaborator Author

There are no errors from the main Site Kit dashboard for that notice to appear, see below.

6qWn2ClnxV

Also it works fine with no errors or "issue accessing data" using an alternative Google account, exact same steps once I reset Sit Kit. (Creating GCP Project and verifying / connecting Analytics module from that same account). Once I reset Sit Kit again the same problem arises when I use the initial account I used when logging this issue

Using same browser, same procedure and incognito.

@ivankristianto
Copy link
Contributor

@jamesozzie Yes we are moving in the right direction.
Just one last detail I need.
Can you expand the response from this request:
Screen Shot 2019-06-21 at 20 59 17

And I would like to see from the preview tab, example:
Screen Shot 2019-06-21 at 21 00 44

and if you can expand the one that has error "InsufficientPermission"

@jamesozzie
Copy link
Collaborator Author

The response from that request is below:

{"search-console::sc-site-analytics::last-28-days::d41d8cd98f00b204e9800998ecf8427e":[{"clicks":0,"ctr":0,"impressions":3,"keys":["2019-05-27"],"position":8.333333333333332},{"clicks":0,"ctr":0,"impressions":3,"keys":["2019-06-04"],"position":59.333333333333336},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-06-17"],"position":79},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-06-16"],"position":15},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-05-26"],"position":92},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-06-14"],"position":83},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-05-31"],"position":1},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-06-12"],"position":8},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-06-03"],"position":94},{"clicks":0,"ctr":0,"impressions":1,"keys":["2019-06-06"],"position":3}],"search-console::search-keywords-sort-by-impressions::last-28-days::d41d8cd98f00b204e9800998ecf8427e":[{"clicks":0,"ctr":0,"impressions":2,"keys":["amp accordion"],"position":75},{"clicks":0,"ctr":0,"impressions":2,"keys":["dfdsfds"],"position":81}],"analytics::traffic-sources::last-28-days::d41d8cd98f00b204e9800998ecf8427e":[{"nextPageToken":null,"columnHeader":{"dimensions":["ga:medium"],"metricHeader":{"metricHeaderEntries":[{"name":"Sessions","type":"INTEGER"},{"name":"Users","type":"INTEGER"},{"name":"New Users","type":"INTEGER"}]}},"data":{"dataLastRefreshed":null,"isDataGolden":null,"rowCount":3,"samplesReadCounts":null,"samplingSpaceSizes":null,"rows":[{"dimensions":["(none)"],"metrics":[{"values":["49","44","44"]}]},{"dimensions":["organic"],"metrics":[{"values":["20","17","17"]}]},{"dimensions":["referral"],"metrics":[{"values":["11","10","9"]}]}],"totals":[{"values":["80","71","70"]}],"minimums":[{"values":["11","10","9"]}],"maximums":[{"values":["49","44","44"]}]}}],"analytics::overview::last-28-days::d41d8cd98f00b204e9800998ecf8427e":[{"nextPageToken":null,"columnHeader":{"dimensions":null,"metricHeader":{"metricHeaderEntries":[{"name":"Users","type":"INTEGER"},{"name":"Sessions","type":"INTEGER"},{"name":"Bounce Rate","type":"PERCENT"},{"name":"Average Session Duration","type":"TIME"},{"name":"Goal Completions","type":"INTEGER"},{"name":"Pageviews","type":"INTEGER"}]}},"data":{"dataLastRefreshed":null,"isDataGolden":null,"rowCount":1,"samplesReadCounts":null,"samplingSpaceSizes":null,"rows":[{"dimensions":null,"metrics":[{"values":["71","80","78.75","39.25","0","114"]},{"values":["116","122","81.14754098360656","28.852459016393443","0","177"]}]}],"totals":[{"values":["71","80","78.75","39.25","0","114"]},{"values":["116","122","81.14754098360656","28.852459016393443","0","177"]}],"minimums":[{"values":["71","80","78.75","39.25","0","114"]},{"values":["116","122","81.14754098360656","28.852459016393443","0","177"]}],"maximums":[{"values":["71","80","78.75","39.25","0","114"]},{"values":["116","122","81.14754098360656","28.852459016393443","0","177"]}]}}],"analytics::site-analytics::last-28-days::d41d8cd98f00b204e9800998ecf8427e":[{"nextPageToken":null,"columnHeader":{"dimensions":["ga:date"],"metricHeader":{"metricHeaderEntries":[{"name":"Sessions","type":"INTEGER"},{"name":"Users","type":"INTEGER"},{"name":"Bounce Rate","type":"PERCENT"},{"name":"Average Session Duration","type":"TIME"},{"name":"Goal Completions","type":"INTEGER"}]}},"data":{"dataLastRefreshed":null,"isDataGolden":null,"rowCount":55,"samplesReadCounts":null,"samplingSpaceSizes":null,"rows":[{"dimensions":["20190426"],"metrics":[{"values":["2","2","50.0","91.0","0"]}]},{"dimensions":["20190427"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190428"],"metrics":[{"values":["3","3","66.66666666666666","12.666666666666666","0"]}]},{"dimensions":["20190429"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190430"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190501"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190502"],"metrics":[{"values":["2","2","50.0","25.0","0"]}]},{"dimensions":["20190503"],"metrics":[{"values":["3","3","100.0","0.0","0"]}]},{"dimensions":["20190504"],"metrics":[{"values":["4","4","50.0","188.25","0"]}]},{"dimensions":["20190505"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190506"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190507"],"metrics":[{"values":["54","54","96.29629629629629","3.5925925925925926","0"]}]},{"dimensions":["20190508"],"metrics":[{"values":["3","2","33.33333333333333","24.333333333333332","0"]}]},{"dimensions":["20190509"],"metrics":[{"values":["3","3","33.33333333333333","152.66666666666666","0"]}]},{"dimensions":["20190510"],"metrics":[{"values":["5","5","40.0","92.4","0"]}]},{"dimensions":["20190511"],"metrics":[{"values":["3","3","66.66666666666666","12.333333333333334","0"]}]},{"dimensions":["20190512"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190513"],"metrics":[{"values":["2","2","0.0","119.5","0"]}]},{"dimensions":["20190514"],"metrics":[{"values":["2","2","50.0","80.5","0"]}]},{"dimensions":["20190515"],"metrics":[{"values":["6","6","100.0","0.0","0"]}]},{"dimensions":["20190516"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190517"],"metrics":[{"values":["4","3","100.0","0.0","0"]}]},{"dimensions":["20190518"],"metrics":[{"values":["3","3","0.0","279.3333333333333","0"]}]},{"dimensions":["20190519"],"metrics":[{"values":["2","2","50.0","0.0","0"]}]},{"dimensions":["20190520"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190521"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190522"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190523"],"metrics":[{"values":["4","4","75.0","8.75","0"]}]},{"dimensions":["20190524"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190525"],"metrics":[{"values":["4","4","100.0","0.0","0"]}]},{"dimensions":["20190526"],"metrics":[{"values":["2","2","50.0","24.0","0"]}]},{"dimensions":["20190527"],"metrics":[{"values":["3","3","66.66666666666666","0.6666666666666666","0"]}]},{"dimensions":["20190528"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190529"],"metrics":[{"values":["4","4","50.0","50.5","0"]}]},{"dimensions":["20190531"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190601"],"metrics":[{"values":["3","3","100.0","0.0","0"]}]},{"dimensions":["20190602"],"metrics":[{"values":["4","4","75.0","10.5","0"]}]},{"dimensions":["20190603"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190604"],"metrics":[{"values":["2","2","100.0","0.0","0"]}]},{"dimensions":["20190605"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190606"],"metrics":[{"values":["2","2","50.0","2.5","0"]}]},{"dimensions":["20190607"],"metrics":[{"values":["7","5","85.71428571428571","24.428571428571427","0"]}]},{"dimensions":["20190608"],"metrics":[{"values":["4","4","75.0","182.5","0"]}]},{"dimensions":["20190609"],"metrics":[{"values":["6","6","100.0","0.0","0"]}]},{"dimensions":["20190610"],"metrics":[{"values":["3","2","66.66666666666666","6.0","0"]}]},{"dimensions":["20190611"],"metrics":[{"values":["6","6","83.33333333333334","5.666666666666667","0"]}]},{"dimensions":["20190612"],"metrics":[{"values":["4","4","75.0","408.25","0"]}]},{"dimensions":["20190613"],"metrics":[{"values":["4","4","75.0","0.25","0"]}]},{"dimensions":["20190614"],"metrics":[{"values":["3","3","100.0","0.0","0"]}]},{"dimensions":["20190615"],"metrics":[{"values":["3","3","100.0","0.0","0"]}]},{"dimensions":["20190616"],"metrics":[{"values":["2","2","50.0","17.0","0"]}]},{"dimensions":["20190617"],"metrics":[{"values":["2","2","50.0","11.0","0"]}]},{"dimensions":["20190618"],"metrics":[{"values":["1","1","0.0","36.0","0"]}]},{"dimensions":["20190619"],"metrics":[{"values":["1","1","100.0","0.0","0"]}]},{"dimensions":["20190620"],"metrics":[{"values":["2","2","0.0","81.0","0"]}]}],"totals":[{"values":["200","195","80.0","33.3","0"]}],"minimums":[{"values":["0","0","0.0","0.0","0"]}],"maximums":[{"values":["54","54","100.0","408.25","0"]}]}}],"analytics::goals::last-28-days::d41d8cd98f00b204e9800998ecf8427e":{"errors":{"403":["User does not have permission to perform this operation."]},"error_data":{"403":{"status":500,"reason":"insufficientPermissions"}}},"analytics::top-pages::last-28-days::d41d8cd98f00b204e9800998ecf8427e":[{"nextPageToken":"10","columnHeader":{"dimensions":["ga:pagePath","ga:pageTitle"],"metricHeader":{"metricHeaderEntries":[{"name":"Pageviews","type":"INTEGER"},{"name":"Unique Pageviews","type":"INTEGER"},{"name":"Bounce rate","type":"PERCENT"}]}},"data":{"dataLastRefreshed":null,"isDataGolden":null,"rowCount":15,"samplesReadCounts":null,"samplingSpaceSizes":null,"rows":[{"dimensions":["/","Mobile DJ Gorey, Wexford Wedding DJ, Gorey Wedding DJ | Floorfillers"],"metrics":[{"values":["83","71","80.28169014084507"]}]},{"dimensions":["/contact","Floorfillers - Contact | Floorfillers"],"metrics":[{"values":["5","3","0.0"]}]},{"dimensions":["/weddings","Floorfillers - Weddings | Floorfillers"],"metrics":[{"values":["5","4","0.0"]}]},{"dimensions":["/about","Floorfillers - About | Floorfillers"],"metrics":[{"values":["4","2","0.0"]}]},{"dimensions":["/contact/make-a-payment","Floorfillers - Make a Payment | Floorfillers"],"metrics":[{"values":["3","2","0.0"]}]},{"dimensions":["/about/experience","Floorfillers - Experience | Floorfillers"],"metrics":[{"values":["2","2","100.0"]}]},{"dimensions":["/about/testimonials?fbclid=IwAR3ADZ9ojuakA7QrPTr1fLPpK71RfS7PNkSdVyoraJmDXg4PXf6fFseTB90","Floorfillers - Testimonials | Floorfillers"],"metrics":[{"values":["2","1","0.0"]}]},{"dimensions":["/index.php/weddings","Floorfillers - Weddings | Floorfillers"],"metrics":[{"values":["2","1","0.0"]}]},{"dimensions":["/weddings/wedding-packages","Floorfillers - Wedding Packages | Floorfillers"],"metrics":[{"values":["2","2","100.0"]}]},{"dimensions":["/?fbclid=IwAR0DrEE9Un2JW3E17_3bURDVrnU4XmW0n8r6f68MJaB6-GRQsoa71XrKXRg","Floorfillers - Home | Floorfillers"],"metrics":[{"values":["1","1","100.0"]}]}],"totals":[{"values":["114","94","78.75"]}],"minimums":[{"values":["1","1","0.0"]}],"maximums":[{"values":["83","71","100.0"]}]}}]}

And the info from the preview tab below:
Screen Shot 2019-06-21 at 5 16 51 PM

@ivankristianto
Copy link
Contributor

@jamesozzie
Thank you so much for the details.
This definitely helpful.
This case is because you haven't setup any goals in the analytics and it throw insufficientPermission.
We should have better checking insufficientPermission to ensure the alert won't cause confusion.

I'll work on this.

@ivankristianto
Copy link
Contributor

@felixarntz / @adamsilverstein
The root cause of this issue is in our data module:
https://github.com/google/site-kit-wp/blob/develop/assets/js/components/data.js#L275-L280
we check if insufficientPermission is because lack of oauth scopes, which could be happened in most of the cases.
But in this case the insufficientPermission is because user doesn't have access to the Analytics Goal, could be a shared Analytics account.

Technical implementation:
Moves the error checking from the data module, exactly these lines:
https://github.com/google/site-kit-wp/blob/develop/assets/js/components/data.js#L275-L288
to withdata (HOC).
So each request could define the error handler.
By remove those lines also ensure the data module, only deal with data request and not adding logic intercept.

@ivankristianto
Copy link
Contributor

@jamesozzie
I'm trying to replicate the insufficientPermission error to test my fixes.
Can you tell me how did you setup your Google Analytics account? Is it a Shared Google Analytics account?

@jamesozzie
Copy link
Collaborator Author

It's not a shared Google analytics account, but I do have 2FA setup, with a notice going to my phone to approve ("Yes, that was me"). Would that have any effect during initial setup - if I didn't notice on my phone.

@ivankristianto
Copy link
Contributor

@jamesozzie
I did try to fix the issue. But since I cannot replicate the issue with real data, can you please help me to test on your end?
here is the zip package contain that fix specifically.
google-site-kit.zip

@jamesozzie
Copy link
Collaborator Author

@ivankristianto It worked for me fine that time. I will check on other sites too and report if I see the same issue arising.

@jamesozzie
Copy link
Collaborator Author

@ivankristianto Just to let you know I am unable to reproduce the issue using your fix.

@ivankristianto
Copy link
Contributor

Thanks @jamesozzie
Can you please help me get the data again from what you did in this comment:
#12 (comment)

Please ensure you are in new tab so you won't hit browser cache.

@jamesozzie
Copy link
Collaborator Author

I deleted the project from Cloud Console, deleted Site Kit and installed again from incognito mode. I used the same Google profile for OAUTH and to verify, the same account that holds the Analytics account and profile which I connected to.

Console Error:
JQMIGRATE: Migrate is installed, version 1.4.1
wp-polyfill.min.js?ver=7.0.0:1 @babel/polyfill is loaded more than once on this page. This is probably not desirable/intended and may have consequences if different versions of the polyfills are applied sequentially. If you do need to load the polyfill more than once, use @babel/polyfill/noConflict instead to bypass the warning.

Response message:
{"analytics::goals::last-28-days::d41d8cd98f00b204e9800998ecf8427e":{"errors":{"403":["User does not have permission to perform this operation."]},"error_data":{"403":{"status":500,"reason":"insufficientPermissions"}}}}

Preview:
{,…}
analytics::goals::last-28-days::d41d8cd98f00b204e9800998ecf8427e: {errors: {403: ["User does not have permission to perform this operation."]},…}
error_data: {403: {status: 500, reason: "insufficientPermissions"}}
403: {status: 500, reason: "insufficientPermissions"}
reason: "insufficientPermissions"
status: 500
errors: {403: ["User does not have permission to perform this operation."]}
403: ["User does not have permission to perform this operation."]
0: "User does not have permission to perform this operation."

Screen Shot 2019-07-03 at 9 57 05 AM

vRX5RjJYeb

When I go back to the Analytics module and change the dropdown to select "Setup a new Property" I don't see the error anymore, no console or network response errors. Revisiting that section the property field remains blank, see below:
Screen Shot 2019-07-03 at 10 08 12 AM

@ThierryA ThierryA modified the milestones: 1.0.0-beta.1.0.1, 1.0.0-beta.1.0.2 Jul 3, 2019
@google google deleted a comment from ivankristianto Jul 5, 2019
@dominikbullo
Copy link

Same there.. :)

@ThierryA ThierryA removed this from the 1.0.0-beta.1.0.2 milestone Jul 9, 2019
@felixarntz
Copy link
Member

@ivankristianto Regarding implementation brief:

Handle insufficientPermission error specifically in AnalyticsDashboardWidgetTopLevel component

Why does it need extra handling?

I have the preliminary work here:
https://github.com/google/site-kit-wp/compare/fix/insufficient-permission?expand=1

The code there still adds the reauth notification - that shouldn't be there as the acceptance criteria say. The server already handles any mismatch in OAuth scopes, which is the sole purpose of the DashboardAuthAlert component.

@adamsilverstein
Copy link
Collaborator

adamsilverstein commented Jul 9, 2019

Handle insufficientPermission error specifically in AnalyticsDashboardWidgetTopLevel component

Why does it need extra handling?

Because in most cases when an API returns the insufficientPermission error it indicates that the user has insufficient scopes, which we handled by displaying the DashboardAuthAlert component.

In the case of Analytics however, even when the user has the correct scopes, they may not have access to view Goals (not 100% certain how to reproduce this state - probably by sharing read access to a property or view. Goals are created by users and can be shared).

In this case, the API returns the same insufficientPermission code we were watching for to indicate incorrect scopes. The user already has the correct scopes and does not need to re-Auth, they likely need to request additional access from the account owner.

Moving the error check from data.js to withData->getDataError enables overriding the default error handling on a per-component level. We can then extend the data object for AnalyticsDashboardWidgetTopLevel where the goal data is requested and add the custom behavior to handle the error code

The code there still adds the reauth notification - that shouldn't be there as the acceptance criteria say. The server already handles any mismatch in OAuth scopes, which is the sole purpose of the DashboardAuthAlert component.

Ah, I assume you are referring to here:

const addAuthNotification = createAddToFilter( <DashboardAuthAlert /> );
if ( setup.needReauthenticate ) {
addFilter( 'googlesitekit.DashboardNotifications',
'googlesitekit.AuthNotification',
addAuthNotification, 1 );
}

So the handling of insufficientPermission doesn't need to be added to withData at all, we can remove that handling entirely. We may still want to handle the error for goals explicitly since we want to help the user set up / gain access to Goals or alternately show them some other data they do have access to. What do you think?

.

@ivankristianto
Copy link
Contributor

ivankristianto commented Jul 10, 2019

@felixarntz & @adamsilverstein

Why does it need extra handling?

Same with Adam, since the response data back from the Analytics API when getting a goal return insufficientPermission and there is no way to differentiate that with lack of oauth scopes approved by user.
see this response data sample:

{"analytics::goals::last-28-days::d41d8cd98f00b204e9800998ecf8427e":{"errors":{"403":["User does not have permission to perform this operation."]},"error_data":{"403":{"status":500,"reason":"insufficientPermissions"}}}}

So the handling of insufficientPermission doesn't need to be added to withDat at all, we can remove that handling entirely.

Yes I agree on this. And we still need to handle insufficientPermission case by case basis on some modules.

@lilybonney
Copy link
Collaborator

@adamsilverstein - Can I assign this one back over to you to update the implementation brief, based on Ivan and Felix's latest comments?

@adamsilverstein
Copy link
Collaborator

@lilybonney yep - I'll get that updated

@adamsilverstein adamsilverstein removed their assignment Jul 18, 2019
@felixarntz felixarntz self-assigned this Jul 18, 2019
@felixarntz
Copy link
Member

Implementation brief looks good now!

@felixarntz felixarntz removed their assignment Jul 18, 2019
@lilybonney lilybonney added this to the 1.0.0-beta.1.0.3 milestone Jul 19, 2019
@aaemnnosttv aaemnnosttv self-assigned this Jul 22, 2019
@aaemnnosttv
Copy link
Collaborator

Assigning this back to @jamesozzie as this is not something we are able to reproduce on our end.

Even with read-only permissions for Analytics using a shared account, the goals still comes back from the API without any error for insufficient permissions.

@aaemnnosttv aaemnnosttv added Type: Support Support request and removed P0 High priority Size: M labels Jul 23, 2019
@aaemnnosttv aaemnnosttv removed this from the 1.0.0-beta.1.0.3 milestone Jul 23, 2019
@aaemnnosttv aaemnnosttv removed the Type: Bug Something isn't working label Jul 23, 2019
@jamesozzie
Copy link
Collaborator Author

Closing as issue no longer persists

@ktmn
Copy link

ktmn commented Jul 27, 2019

This fix is coming in 1.0.3? I currently have this problem with 1.0.2. I then installed the version from here, the "Issue accessing data" notice disappeared, but all reports are saying "data is not yet available, please check back later" except for one which says "Data error in Analytics - Your account does not have permission to perform this operation.".

No JS console errors.

The initial XHR request after page load still responds with {"analytics::goals::last-28-days::...":{"errors":{"403":["User does not have permission to perform this operation."]},"error_data":{"403":{"status":500,"reason":"insufficientPermissions"}}}}

If you could post 1.0.3 zip with that fix I can test with that.

@ktmn
Copy link

ktmn commented Aug 14, 2019

Any update?

@jamesozzie
Copy link
Collaborator Author

@ktmn In relation to your error can you try the following:

  1. Disconnect the Analytics module (Site Kit > Settings > Analytics > Edit > Disconnect Analytics from Site Kit)
  2. Temporarily deactivate any caching plugin (Autoptimize, WP Super Cache etc)
  3. Open Site Kit in a new incognito window (which ensures browser extensions/caching doesn't interfere with the setup process)
  4. Connect the Analytics module (Site Kit > Settings > Connect other services > Analytics)

If the above fails to resolve your issue can you please share the following:

  • Any console errors that appear
  • Your WordPress Site Health information
  • Any security plugins or software in use (ModSecurity, iThemes, WordFence etc)

As you are encountering a 403 error you might also want to check your Analytics account, and ensure there are no access issues with the site being connected to Site Kit.

@andydesigns
Copy link

I'm also still experiencing this issue with version 1.0.5

I tried your suggestions above but it hasn't helped. There is only one console error:

'Deprecation warning: use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'

My Site Health info is listed below without live urls and I have no security plugins installed. I also tried disabling my Litespeed Cache plugin as suggested above.

`

wp-core

version: 5.2.2
site_language: en
user_language: en
permalink: /%postname%/
https_status: true
user_registration: 0
default_comment_status: open
multisite: false
user_count: 2
dotorg_communication: true

wp-paths-sizes

wordpress_path: /home/folder/domain.co.uk
wordpress_size: 114.24 MB (119793724 bytes)
uploads_path: /home/folder/domain.co.uk/wp-content/uploads
uploads_size: 106.55 MB (111728843 bytes)
themes_path: /home/folder/domain.co.uk/wp-content/themes
themes_size: 2.15 MB (2257400 bytes)
plugins_path: /home/folder/domain.co.uk/wp-content/plugins
plugins_size: 78.09 MB (81886179 bytes)
database_size: 12.18 MB (12767029 bytes)
total_size: 313.22 MB (328433175 bytes)

wp-dropins (1)

advanced-cache.php: true

wp-active-theme

name: Domain
version: 0.1
author: My Name
author_website: domain.co.uk
parent_theme: GeneratePress
theme_features: align-wide, editor-styles, editor-style, automatic-feed-links, post-thumbnails, post-formats, woocommerce, title-tag, html5, customize-selective-refresh-widgets, editor-color-palette, responsive-embeds, custom-logo, menus, widgets
theme_path: /home/folder/domain.co.uk/wp-content/themes/generatepress

wp-themes (1)

GeneratePress: version: 2.3.2, author: Tom Usborne

wp-plugins-active (21)

Advanced Custom Fields: version: 5.8.3, author: Elliot Condon
Antispam Bee: version: 2.9.1, author: pluginkollektiv
Code Snippets: version: 2.13.3, author: Shea Bunge
Cookiebot | GDPR Compliant Cookie Consent and Notice: version: 2.5.0, author: Cybot A/S
GP Premium: version: 1.8.3, author: Tom Usborne
Justified Gallery: version: 1.4.2, author: Damian Góra
Kadence Blocks - Gutenberg Page Builder Toolkit: version: 1.6.8, author: Kadence WP (latest version: 1.6.10)
Lazy Blocks: version: 1.7.0, author: nK
LF Hiker: version: 1.13.0, author: epointal
Limit Login Attempts: version: 1.7.1, author: Johan Eenfeldt
LiteSpeed Cache: version: 2.9.8.5, author: LiteSpeed Technologies
Ninja Forms: version: 3.4.18, author: The WP Ninjas
Read More: version: 2.3.4.1, author: Edmon
Safe SVG: version: 1.9.4, author: Daryll Doyle
ShortPixel Adaptive Images: version: 1.2.6, author: ShortPixel
Site Kit by Google: version: 1.0.0-beta.1.0.5, author: Google
TablePress: version: 1.9.2, author: Tobias Bäthge
TablePress Extension: Responsive Tables: version: 1.5, author: Tobias Bäthge
WP Show Posts: version: 1.1.3, author: Tom Usborne
Yet Another Stars Rating: version: 2.0.3, author: Dario Curvino
Yoast SEO: version: 11.9, author: Team Yoast

wp-plugins-inactive (1)

Search & Filter Pro: version: 2.4.5, author: Code Amp

wp-media

image_editor: WP_Image_Editor_Imagick
imagick_module_version: 1684
imagemagick_version: ImageMagick 6.9.4-10 Q16 x86_64 2017-05-23 http://www.imagemagick.org
imagick_limits:
imagick::RESOURCETYPE_AREA: 43 GB
imagick::RESOURCETYPE_DISK: 1.844674407371E+19
imagick::RESOURCETYPE_FILE: 75000
imagick::RESOURCETYPE_MAP: 43 GB
imagick::RESOURCETYPE_MEMORY: 22 GB
imagick::RESOURCETYPE_THREAD: 1
gd_version: bundled (2.1.0 compatible)
ghostscript_version: 9.07

wp-server

server_architecture: Linux 3.10.0-714.10.2.lve1.4.65.el7.x86_64 x86_64
httpd_software: LiteSpeed
php_version: 7.1.31 64bit
php_sapi: litespeed
max_input_variables: 1000
time_limit: 30
memory_limit: 256M
max_input_time: -1
upload_max_size: 64M
php_post_max_size: 64M
curl_version: 7.62.0 OpenSSL/1.0.2k
suhosin: false
imagick_availability: true
htaccess_extra_rules: true

wp-database

extension: mysqli
server_version: 10.0.38-MariaDB-cll-lve
client_version: 10.0.38-MariaDB

wp-constants

WP_HOME: undefined
WP_SITEURL: undefined
WP_CONTENT_DIR: /home/folder/domain.co.uk/wp-content
WP_PLUGIN_DIR: /home/folder/domain.co.uk/wp-content/plugins
WP_MAX_MEMORY_LIMIT: 256M
WP_DEBUG: false
WP_DEBUG_DISPLAY: true
WP_DEBUG_LOG: false
SCRIPT_DEBUG: false
WP_CACHE: true
CONCATENATE_SCRIPTS: undefined
COMPRESS_SCRIPTS: undefined
COMPRESS_CSS: undefined
WP_LOCAL_DEV: undefined

wp-filesystem

wordpress: writable
wp-content: writable
uploads: writable
plugins: writable
themes: writable
mu-plugins: writable

`

Also it appears to be pulling in data from a different site as the figures don't match my actual analytics and article titles are not from my site.
Could having a Google Tag Manager script setup on the site already be affecting the authentication?.

Any help appreciated.

@andydesigns
Copy link

Any help would be appreciated.

@jamesozzie
Copy link
Collaborator Author

@andydesigns Apologies for the delay. I don't see anything immediately in relation to your setup or plugins that could be causing this problem, although I am not familiar with all the plugins.

While having the Tag Manager script setup on the site shouldn't impact the Site Kit setup you could have some containers with code inserted which could potentially impact reporting. Can you try the following:

  • Temporarily remove the Tag Manager snippet
  • Temporarily deactivate the AntiSpam Bee, Ninja Forms and Code Sockets plugins
  • Disable ModSecurity if enabled from your web host

If the above fails do you have another site on the same web host which you check Site Kit setup with?

@Luqman000
Copy link

Analytics data is not yet available, please check back later.
https://www.dropbox.com/s/ymhmu49v7pvd3ca/annotation%202020-05-01%20225705.png?dl=0
can you help why this occour and no error in console. I am also apply all solution, you explain on different forum. but all in vain,,,
my site url : https://mavenofmacau.com/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Support Support request
Projects
None yet
Development

No branches or pull requests