Don't display the blue notice bar until a user selects either a GA4 or UA property when connecting Analytics.
See original GitHub issueWhen setting up Analytics and selecting an account which has both a UA and GA4 property don’t display the blue notice bar regarding the creation of an additional property until a user makes a selection.
This would lead to less confusion considering the notice bar that appears on account selection assumes the user will select a UA property.
Screenshot of the current blue bar that appears upon selecting an Analytics account with both a UA and GA4 property.
The blue notice assumes a user will select a UA property. If the user selects a GA4 property the notice does change, which is ideal however an improvement would be to only display that notice when a property selection has been made.
Steps to reproduce
- Setup Site Kit
- Connect Analytics
- Select an account that has both a UA and GA4 property
- The blue notice bar appears before the user makes a property selection, assuming they will select a UA property.
Screenshots
Additional Context
- PHP Version:
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Plugin Version [e.g. 22]
- Device: [e.g. iPhone6]
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- In the Analytics setup flow (with
ga4Setup
flag active), any of the three new blue notices around the associated other property (whether about creating a new one or selecting a matching one) should only appear when a property is already selected in the primary dropdown.- In other words, if no account/property is selected or if only an account has been selected, the notice should not be visible yet.
Implementation Brief
- Update the
SetupFormUA
component:- Pull UA propertyID using the
getPropertyID
selector - Update the
shouldShowGA4PropertyNotice
constant to also check if the propertyID is not empty.
- Pull UA propertyID using the
- Update the
SetupFormGA4
component:- Pull GA4 propertyID using the
getPropertyID
selector - Update the
GA4PropertyNotice
element to render it only when thepropertyID
is not empty.
- Pull GA4 propertyID using the
- Update the
SetupFormGA4Transitional
component:- Pull GA4 propertyID using the
getPropertyID
selector of the analytics-4 module - Update the
GA4PropertyNotice
element to render it only when either UA or GA4 propertyID is not empty.
- Pull GA4 propertyID using the
Test Coverage
- N/A
Visual Regression Changes
- N/A
QA Brief
- Setup Site Kit
- Connect Analytics using an account with a bunch of properties but none that matches the current site URL
- Check that the blue notice bar for the GA4 property does not appear before the user makes a property selection
Changelog entry
- Show information notice about associated UA / GA4 property only once a property has been selected.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (5 by maintainers)
@tofumatt @Hazlitte It is not entirely correct that the selection cannot be empty.
property_create
is a different value from''
, which is the initial state, and that specifically is what we need to cater for here. If the value isproperty_create
, a selection has been made, so here the notice still needs to be shown. It should only not be shown if the property selection is''
.The reason it can be tricky to get to that state is that you’ll need to have an account with a bunch of properties but none that matches your current site URL. If you do, Site Kit will pre-select that, and you can never manually get to unselect the property. The easiest way to actually preview the situation that needs to be checked here is to modify the datastore manually via the browser console, e.g.
googlesitekit.data.dispatch('modules/analytics').setPropertyID('')
.QA Update: Pass ✅