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
Refactor Analytics account and property dropdowns to source from account summaries #7637
Comments
|
Hi @nfmohit, this IB is looking good. A few points to consider:
|
Thank you for the kind and detailed review here, @techanvil. I've updated the IB accordingly, and have also bumped up the estimate by one notch. Please let me know if it looks good now, thanks! |
|
Thanks @nfmohit, that's great. IB LGTM ✅ |
QA Update:
|
|
@wpdarren, no, a network call shouldn't be made to the cc: @bethanylang |
QA Update: ✅Verified:
|
|
Issue 1: @mohitwp raised an issue on Slack that creating a GA4 new property from the settings screen throws an error. This is because the account summaries weren't loaded after creating a new property. Hence, the newly created property was only available after reloading the page. Recording.723.mp4Issue 2: While investigating the above issue, I found that the Screen.Recording.2024-01-10.at.5.25.43.PM.movI have fixed the above issues in this follow-up PR. |
Enhance/#7637 - Fix data synchronization issue when creating a new property
QA Update: ❌@hussain-t I see strange UX/UI behavior when creating a new property and web data stream on the initial setup. I haven't tested the settings yet, but will do so and report back.
new-property.mp4
new-web.mp4 |
|
@wpdarren, I'm looking into the first issue. As for creating a new web data stream error, it was from the API. No server-side changes were made as part of this ticket. Let's create a new ticket to address it. |
|
As discussed on Slack, the issue occurred due to the build issue. |
QA Update: ✅@hussain-t thanks for the investigation! Just to clarify, point 2 I will create a new ticket and point 1 is not an issue now the site has an updated main branch. I will raise this issue with Evan on our next QA sync as it is rather annoying that this happens as it involves additional work for you and me. I did refresh the main numerous times, but it wasn't until we selected the latest and then the main that the build was completed properly. Verified:
Additional testing around setting up Analytics and creating new properties in the connect Analytics screen and also in Analytics settings. The issues reported above are now fixed. |
This is a known issue; see #6727 As for the calls to |









Feature Description
The setup and settings interfaces for Analytics use dropdowns for selecting the account and properties to manage the connected property (and now datastream for tagging).
This was initially built to use endpoints based on
accounts.listandproperties.listwhich return much more data than is needed and can result in multiple calls. Account Summaries are a leaner resource for getting an overview of nearly all accounts and their properties that a user has access to in a single request. We already use account summaries for some things but the main interface still uses the initial architecture based on the less efficient resources.Now that setup with UA is no longer possible, we can start refactoring the connection management interface to use GA4 account summaries for accounts and properties entirely which should result in a more performant experience as well.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
assets/js/modules/analytics-4/datastore/accounts.js:getAccountsthat should return the state value foraccountSummaries. However, it should use a resolver to auto-select matching account ID and GA4 property ID. This can be adapted from theMODULES_ANALYTICSgetAccountsresolver (only the last part specific to GA4).assets/js/modules/analytics-4/datastore/properties.js:getPropertySummariesthat should accept anaccountIDstring parameter. It should use theMODULES_ANALYTICS_4getAccountSummariesselector to get all account summaries, and return thepropertySummariesarray parameter for the provided account ID.waitForPropertiesaction, create a newwaitForPropertySummariesaction that should accept anaccountIDstring parameter and use a control to await resolve select the newgetPropertySummariesselector passing the providedaccountIDas a parameter.matchAccountPropertyaction to:waitForPropertySummariesaction instead ofwaitForProperties.getPropertySummariesselector instead ofgetProperties.isLoadingPropertySummaries:isLoadingPropertiesselector.isResolvinggetPropertiesselector for theisResolvingPropertiesvariable definition, it should instead useMODULES_ANALYTICS_4isResolvinggetAccountSummariesselector.waitForPropertiesaction is no longer needed and should be removed.isLoadingPropertiesselector is no longer needed and should be removed.assets/js/modules/analytics-4/components/settings/SettingsEnhancedMeasurementSwitch.js&assets/js/modules/analytics-4/components/setup/SetupEnhancedMeasurementSwitch.js:isLoadingPropertiesselector usage should be replaced with the newisLoadingPropertySummariesselector.assets/js/modules/analytics-4/components/common/AccountSelect.js:assets/js/modules/analytics/components/common/AccountSelect.js.accountsvariable definition, use thegetAccountsselector from theMODULES_ANALYTICS_4store.hasResolvedAccountsvariable definition, use thehasFinishedResolutionselector from theMODULES_ANALYTICS_4store.useEffectand all other relevant unused variable definitions.<Select>component, instead of using theidproperty from destructuredaccountsarray items, use_id.assets/js/modules/analytics/components/setup/SetupFormGA4.js&assets/js/modules/analytics/components/settings/GA4SettingsControls.js:AccountSelectcomponent being used should be imported fromassets/js/modules/analytics-4/components/common/AccountSelect.js.assets/js/modules/analytics-4/components/common/PropertySelect.js:MODULES_ANALYTICSgetAccountsselector, use it fromMODULES_ANALYTICS_4.propertiesvariable definition, use theMODULES_ANALYTICS_4getPropertySummariesselector.isLoadingvariable definition, use theMODULES_ANALYTICS_4isLoadingPropertySummariesselector.Storybook
Test Coverage
AccountSelectcomponent, similar to the existing legacy version.analytics-4getAccountsselector.analytics-4getPropertySummariesselector.isLoadingPropertiesin this test case should be replaced withisLoadingWebDataStreams.QA Brief
account-summariesendpoint.account-summariesendpoint response from the network tab.accounts-properties-profilesandpropertiesendpoints to load the accounts and properties.properties-profilesendpoint will still be made upon changing the account as it was called by theselectAccountaction.Additional Notes:
accounts-properties-profilesendpoint.accounts-properties-profilesendpoint. This difference is expected and should not be considered a bug.Update
Changelog entry
The text was updated successfully, but these errors were encountered: