site-kit-wp
site-kit-wp copied to clipboard
Remove GA4 API stability related conditions and fallbacks
Feature Description
With the release of the beta version of the Analytics Admin v1 API, we can now remove the stability related functionality that was added to support the use of the alpha version of the API.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The
isAdminAPIWorkingselector for GA4 should be removed entirely- All instances where it was used should be updated as if it were returning
true, just like any other API
- All instances where it was used should be updated as if it were returning
- This change should not be merged before https://github.com/google/site-kit-wp/issues/5574 although it can be started at any time
Implementation Brief
- Delete the following files
assets/js/modules/analytics-4/datastore/api.jsassets/js/modules/analytics-4/datastore/api.test.jsassets/js/modules/analytics/components/setup/SetupFormLegacy.js
- In
assets/js/modules/analytics-4/datastore/index.jsfile:- Remove the
apiimport and usage in thestore = Data.combineStores.
- Remove the
- In
assets/js/modules/analytics/datastore/setup-flow.jsfile:- Inside the
getSetupFlowModeselector, remove the usage ofisAdminAPIWorkingselector and theisAdminAPIWorking === falsecode path. - Remove unused
SETUP_FLOW_MODE_LEGACYimport. - Remove unnecessary
SETUP_FLOW_MODE_LEGACYtests fromsetup-flow.test.js.
- Inside the
- In
assets/js/modules/analytics/components/setup/SetupForm.jsfile:- Remove Legacy Setup From from the JSX.
- Remove unresolved/unused imports.
- In
assets/js/modules/analytics/datastore/constants.jsfile:- Remove
SETUP_FLOW_MODE_LEGACYconstant.
- Remove
- In
assets/js/modules/analytics/components/settings/GA4SettingsControls.jsfile:- Remove usage of
isAdminAPIWorkingselector. - Update all the conditions that depend on it to assume it's true and remove other code paths.
- For Example:
- Remove usage of
- if ( isAdminAPIWorking ) {
setMatchedProperty( undefined );
setMatchedWebDataStream( undefined );
matchGA4Information();
- }
---
- if ( isAdminAPIWorking === undefined ) {
- return <ProgressBar height={ isDisabled ? 180 : 212 } small />;
- }
- if ( ! isAdminAPIWorking ) {
- return null;
- }
- In
assets/js/modules/analytics-4/datastore/settings.jsfile:- Remoce the usage of
isAdminAPIWorkingselector invalidateCanSubmitChangesfunction.
- Remoce the usage of
Test Coverage
- No new tests needed.
- Remove tests for
isAdminAPIWorkingandSETUP_FLOW_MODE_LEGACY. - Update all failing tests.
- Remove GA Legacy Setup Stories and VRTs (if any).
QA Brief
Changelog entry
IB ✔️
flagging here that this is blocked until the v1beta classes are published in the client services libraries. See https://github.com/googleapis/google-api-php-client-services/tree/main/src/GoogleAnalyticsAdmin
Maintainers have been notified about this but no update yet.
Hi @kuasha420 and @aaemnnosttv so we have an update on these tickets, are they both still blocked? Thanks!
Yes, unfortunately. I've raised it again so hopefully it won't be much longer 🤞
QA Update ✅
- Verified on dev.
- Verified analytics set up for both GA4 and UA.
- Tested GA4 activation set up banner functionality.
- All instances of 'isAdminAPIWorking' removed from GA4 API's.
Latest -

dev-
