site-kit-wp icon indicating copy to clipboard operation
site-kit-wp copied to clipboard

Remove GA4 API stability related conditions and fallbacks

Open aaemnnosttv opened this issue 3 years ago • 2 comments

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 isAdminAPIWorking selector 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
  • 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.js
    • assets/js/modules/analytics-4/datastore/api.test.js
    • assets/js/modules/analytics/components/setup/SetupFormLegacy.js
  • In assets/js/modules/analytics-4/datastore/index.js file:
    • Remove the api import and usage in the store = Data.combineStores.
  • In assets/js/modules/analytics/datastore/setup-flow.js file:
    • Inside the getSetupFlowMode selector, remove the usage of isAdminAPIWorking selector and the isAdminAPIWorking === false code path.
    • Remove unused SETUP_FLOW_MODE_LEGACY import.
    • Remove unnecessary SETUP_FLOW_MODE_LEGACY tests from setup-flow.test.js.
  • In assets/js/modules/analytics/components/setup/SetupForm.js file:
    • Remove Legacy Setup From from the JSX.
    • Remove unresolved/unused imports.
  • In assets/js/modules/analytics/datastore/constants.js file:
    • Remove SETUP_FLOW_MODE_LEGACY constant.
  • In assets/js/modules/analytics/components/settings/GA4SettingsControls.js file:
    • Remove usage of isAdminAPIWorking selector.
    • Update all the conditions that depend on it to assume it's true and remove other code paths.
    • For Example:
-  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.js file:
    • Remoce the usage of isAdminAPIWorking selector in validateCanSubmitChanges function.

Test Coverage

  • No new tests needed.
  • Remove tests for isAdminAPIWorking and SETUP_FLOW_MODE_LEGACY.
  • Update all failing tests.
  • Remove GA Legacy Setup Stories and VRTs (if any).

QA Brief

Changelog entry

aaemnnosttv avatar Jul 19 '22 19:07 aaemnnosttv

IB ✔️

eugene-manuilov avatar Jul 26 '22 09:07 eugene-manuilov

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

eclarke1 avatar Aug 24 '22 12:08 eclarke1

Maintainers have been notified about this but no update yet.

aaemnnosttv avatar Aug 29 '22 17:08 aaemnnosttv

Hi @kuasha420 and @aaemnnosttv so we have an update on these tickets, are they both still blocked? Thanks!

FlicHollis avatar Nov 13 '22 16:11 FlicHollis

Yes, unfortunately. I've raised it again so hopefully it won't be much longer 🤞

aaemnnosttv avatar Nov 14 '22 23:11 aaemnnosttv

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 -

image

dev-

image

mohitwp avatar Jan 03 '23 10:01 mohitwp