-
Notifications
You must be signed in to change notification settings - Fork 286
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
Implement ability to create custom dimensions from metric tiles #7601
Comments
Hey @nfmohit, this AC is well written but again, it's going into IB territory where it doesn't really need to.
|
Thank you for the kind review, @techanvil. I've addressed your feedback as the following:
This has been updated.
Updated as well.
You're correct, this was a mistake. This should actually rely on the key metrics widget area for custom dimensions creation if Site Kit is supposed to create them automatically. If Sit Kit is not supposed to create them automatically, the error state CTA should trigger it. I've updated the section.
Thank you for pointing out, updated. Please let me know if this looks good, thank you! |
Thanks @nfmohit, that looks great! AC LGTM ✅ |
Thanks @zutigrm! A few general points about the IB as it relates to the guidelines which I encourage you to review as a refresher.
This directory probably isn't necessary as we can add the
AFAIU this would only be used for errors related to custom dimension actions, correct? If so, let's name this accordingly as I believe we'd still be using
This may be insufficient as most resolvers have a condition to return early if there is already data in state for it which we will still likely want to keep/implement for consistency, but also to minimize the need for fetch mocks in tests. One way around this could be to have an additional flag in state that we can enable when we want to do this to bypass this guard in the resolver. Using a resolver for this is a good idea though because it solves the issue of ensuring it's only done once, regardless of how many custom dimensions error. Question about the AC for @nfmohit
Is this issue intended to implement the background creation mentioned here? If not, where is this being handled? |
@aaemnnosttv Thank you for the feedback.
What about using the
To chip in here, creation of metrics infra and it's actions is being added in #7598. |
Hi @aaemnnosttv. Triggering the creation of custom dimensions is a part of #7599. However, it is also notable that the error state introduced in this current issue will also trigger automatic creation of custom dimensions. |
@wpdarren Just chatted with @aaemnnosttv about this one and it seems like there are actually issues here on both the service side and the plugin side. For the service, this link was added to the Error States MVP Mapping (Get help) sheet as opposed to the Documentation URLs (Learn more) sheet. This was 100% on me as I had asked @jamesozzie to make this change. James, I'll follow up with an Asana task for you to get this added to Documentation URLs (Learn more) instead. For the plugin, the URL that's being generated for the Learn more link is https://sitekit.withgoogle.com/support?error=The%20caller%20does%20not%20have%20permission, which is not the correct structure. Because there is no page at that URL, you're being directed to the fallback URL of https://sitekit.withgoogle.com/documentation/troubleshooting/using-troubleshooting-mode/, which is also not particularly helpful. I'll open up a new Asana task to get this fallback URL changed. But the tl;dr here is that there is, in fact, an issue in the plugin in terms of how this URL is being served that will need to be investigated and fixed. Ongoing Slack thread about all of this here! I'm offline beginning tomorrow but Evan is aware of this issue and can help as needed. Thanks! |
Update: @jamesozzie has been asked to update the Learn more sheet in this Asana task. @wpdarren Depending on timing, this may not be fixed on the service side by the time a fix is in place on the plugin side for the URL structure issue. @aaemnnosttv Can you please clarify what the correct URL structure should be, so that even if the correct URL isn't being served from the service, Darren can confirm that the fix is correct on the plugin side? Thanks! |
I just looked into this a bit more closely and so long as the intention is to use the same invalid permissions error that we have now, then the support URL was added to the correct sheet (as an error). The plugin needs to be updated to rewrite the error as we're doing for report errors to provide the proper site-kit-wp/assets/js/components/ReportErrorActions.js Lines 78 to 80 in 73868dc
site-kit-wp/assets/js/modules/analytics-4/components/key-metrics/InsufficientPermissionsError.js Lines 48 to 50 in 73868dc
It should be
Sending this back for a follow-up 👍 |
QA Update: ❌Update: after a brief conversation with Nahid on Slack, it appears that there's an issue with gathering data states on the tiles and the error message when custom dimensions are deleted after creation. @nfmohit an observation on the final section:
I see the Any ideas why this could be? |
@wpdarren & @nfmohit from what I can see, the sync in response to the missing custom dimension error in the main report works as expected on the current Sending this back to QA as is in case there is anything else to check here, and I'll open a new issue about the remaining work for this to work properly with dimensions that are still gathering data. |
QA Update: ✅Verified: Please note that I went through the ACs and can confirm that all of the error states work as expected, other than the issue reported above about the gathering state.
Insufficient permissions error state
Generic error state
Custom dimension is deleted after creation
|
Feature Description
A metric tile dependent on custom dimensions should use a new wrapper/utility that goes on to create the custom dimension(s) it depends on.
See:
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
INVALID_ARGUMENT
error.status
, the locally persisted list of available custom dimensions might not be up to date and that should be updated. This update should be triggered only once so that multiple metric tiles do not attempt to update this at the same time.Insufficient permissions
You’ll need to contact your administrator. Learn more (link) <br> Permissions updated? Retry (link)
Learn more
should take the user to the Site Kit support URL with anerror_id
ofanalytics-4_insufficient_permissions
.Retry
should attempt to create the custom dimensions again.Analytics update failed
.Retry didn't work? Get help (link)
Retry
Get help
should take the user to the Site Kit support URL with anerror_id
of the encountered error code.Retry
should attempt to create the custom dimensions again.No data to show
Update Analytics to track metric
Update
Update
should direct the user to the OAuth flow to grant the Analytics “edit” scope in such a way so that Site Kit automatically creates the custom dimensions after they return. This behaviour should already be partially implemented in #7599 and the same should be adopted here as well.No data to show
Update Analytics to track metric
Update
Update
should trigger the creation of custom dimensions.Implementation Brief
assets/js/components/KeyMetrics/CustomDimensionTileWrapper
CustomDimensionErrorActions.js
site-kit-wp/assets/js/components/ReportErrorActions.js
Lines 118 to 135 in 91ce4cd
Insufficient permissions
tile, as well as prop for inlineretry
defined on the same tilegeneric error
CustomDimensionError.js
assets/js/components/KeyMetrics/MetricTileError/index.js
as starting pointtitle
value to the variable so it can be adapted to different messagesEDIT_SCOPE
permission (Example in #7599), and to create custom dimensions by dispatchingcreateCustomDimensions
action introduced in #7598CustomDimensionErrorActions
component for content outputCustomDimensionErrorActions
, and which callback to use for links/buttonEDIT_SCOPE
should modify error output with content defined in design and AC for that scenariohasInsufficientPermissionsError
title and content should matchInsufficient permissions
tile in ACindex.js
reportOptions
hasCustomDimensions
selector to determine if custom dimensions are availablegetErrorForSelector
on the report made by child component, usingreportOptions
propuseMount
oruseEffect
hook, do early check iferror.status
isINVALID_ARGUMENT
and ifgetAvailableCustomDimensions
is not fetching data.syncAvailableCustomDimensions
action, which will in turn create missing custom dimensions and sync theavailableCustomDimensions
state. Just implementisSyncing
selector, andsetIsSyncing
controller, in that store to locksyncAvailableCustomDimensions
action by returning early if itisSyncing
, to prevent multiple calls at the same time.isFetchingCreateCustomDimension
, or perhapshasFinishedResolution
on thegetReport
. And to unify it with child component loading, you can add additional loading prop and combine it in this checkMetricTileLoader
component, with necessary wrappers to keep the styling, you can get them fromMetricTileNumeric
component for example.INVALID_ARGUMENT
, returnCustomDimensionError
componentHere is a summary of the component hierarchy for clarity:
CustomDimensionTileWrapper > CustomDimensionError component (with prompt to update Analytics)
.CustomDimensionTileWrapper > MetricTileLoader
.CustomDimensionTileWrapper > CustomDimensionError component (with relevant error)
.CustomDimensionTileWrapper > Child Tile component
.Storybook
CustomDimensionError
component including its various variants.Test Coverage
QA Brief
newsKeyMetrics
feature flag.Verify insufficient permissions error state
Verify generic error state
Verify scenario where custom dimension is deleted after creation
Top categories by pageviews
metric tile to be visible in the KMW area.Custom definitions
. Archive the 'googlesitekit_post_categories` custom dimension.badRequest
error reason. Once that fails, SK should make another request to sync the custom dimensions and then show the missing dimensions error state ("Update Analytics to track metric") in the tile.Changelog entry
The text was updated successfully, but these errors were encountered: