Closed
Description
Feature Description
Some things will not be needed since feature flag is removed. For example provisioning scope, UAProperty, and some test cases in assets/js/modules/analytics/datastore/accounts.test.js
Existing jest tests should be revisited as well.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- The
analytics
module which has by now become obsolete and replaced byanalytics-4
should be entirely removed from the Site Kit plugin. This should include but may not be limited to:- The
Modules\Analytics
module class and all other classes in this namespace in PHP. - The
modules/analytics
datastore. - The
analytics
module on the client-side.
- The
Implementation Brief
- 7932 will remove most of the Analytics module related code, after it is merged, follow the AC to check if anything remained
- Remove the pieces linked in the description
- Check if any analytics components/modules/widgets counterpart are still present and remove them. Example
AdminBarSessions
should be replaced withAdminBarSessionsGA4
, etc - Search for any remaining usage of
MODULES_ANALYTICS
store selector and replace it withMODULES_ANALYTICS_4
- Remove
assets/js/components/adminbar/common.stories.js
andassets/js/components/wp-dashboard/common.stories.js
- Search for
modules/analytics/data/
through the codebase to identify presence of old Analytics route usage and update/remove the code accordingly
Test Coverage
- In e2e plugin
tests/e2e/plugins/module-setup-analytics-no-account.php
, renamee2e/setup/analytics/account-created
endpoint toe2e/setup/analytics-4/account-created
. And replace its usage in e2e tests where applicable. - In
tests/e2e/plugins/module-setup-analytics.php
- Cleanup the remaining analytics routes, like
properties-profiles
, andprofiles
, but leaveaccounts-properties-profiles
unless it was completely replaced byaccount-summaries
, as at the time of writing we still useaccounts
from that response. If this is completely replaced, we can remove that endpoint too. - Remove the usage of these routes if they are still present. At the time of writing they are still used only in jest tests for accounts and account select.
- Cleanup the remaining analytics routes, like
- Remove the usage of
analytics/data/goals
route from e2e tests, as it was used only by old analytics, GA4 does not have goals. - Remove
analytics/data/report
route from the e2e tests if still present - In
.storybook/fetch-mocks.js
, replaceanalytics
withanalytics-4
- Replace any outstanding usage of
MODULES_ANALYTICS
store withMODULES_ANALYTICS_4
in stories and jest tests. Some of the files at the time of writing:assets/js/components/ReportError.test.js
assets/js/components/ReportError.stories.js
assets/js/components/dashboard-sharing/DashboardSharingSettingsButton.stories.js
assets/js/components/dashboard-sharing/DashboardSharingSettings/index.stories.js
assets/js/components/notifications/GoogleTagIDMismatchNotification.stories.js
assets/js/components/notifications/WebDataStreamNotAvailableNotification.stories.js
assets/js/components/notifications/ZeroDataStateNotifications/index.stories.js
QA Brief
- This PR removes the legacy
analytics
module. No specific checks are needed here. The SAM E2E testing should cover testing this.
Changelog entry
- Remove the legacy
analytics
module (UA) from Site Kit.