Skip to content
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

Cannot recover Analytics module when UA is not connected. #6861

Closed
techanvil opened this issue Apr 12, 2023 · 4 comments
Closed

Cannot recover Analytics module when UA is not connected. #6861

techanvil opened this issue Apr 12, 2023 · 4 comments
Labels
Exp: SP Module: Analytics Google Analytics module related issues P0 High priority Type: Bug Something isn't working

Comments

@techanvil
Copy link
Collaborator

techanvil commented Apr 12, 2023

Bug Description

When Analytics is connected without UA, and then put into a recoverable state, the Module Recovery Alert becomes stuck on the loading state.

Steps to reproduce

Once #6825 and #6846 are implemented:

  1. With the ga4Reporting and dashboardSharing feature flags enabled, setup Site Kit.
  2. Connect Analytics without enabling Universal Analytics.
  3. Share the Analytics module via the Dashboard Sharing modal.
  4. Login as a second admin and navigate to Analytics settings.
  5. Change one of the GA4 settings and save the changes, this will ensure that Analytics is now owned by the second admin.
  6. Disconnect the second admin.
  7. Login again as the first admin.
  8. See the Module Recovery Alert stuck on the loading state.

Screenshots

image.png

Additional Context

  • PHP Version: any
  • OS: any
  • Browser: any
  • Plugin Version: 1.98.0
  • Device: any

Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • When Analytics is connected without UA, and then put into a recoverable state, the Module Recovery Alert should not become stuck on the loading state, and the Analytics module should be recoverable as usual.
  • In this scenario the Analytics module can be listed as "Analytics 4" rather than "Analytics" on the recovery alert.

Implementation Brief

Update getRecoverableModules() to return analytics-4 instead of analytics when the GA4 Dashboard View is enabled.

Within assets/js/googlesitekit/modules/datastore/modules.js, in the *getRecoverableModules() resolver:

  • Check if the list of modules contains a recoverable analytics module.
  • If so, yield an await for the Analytics getSettings() selector to resolve, in order for the dashboardView setting to be immediately available.
  • At the point where the module slug is being pushed to moduleList:
    • Check if the module slug is analytics and if isGA4DashboardView() is true.
    • If so, push analytics-4 instead of analytics to moduleList.

Within assets/js/components/notifications/ZeroDataStateNotifications/index.js:

Within assets/js/modules/search-console/components/dashboard/SearchFunnelWidgetGA4/index.js:

Test Coverage

  • Extend the getRecoverableModules() test coverage to cover this new behaviour.

QA Brief

  • Follow the Steps to reproduce mentioned in the issue description.
  • Verify that the modules needed to be recovered shows up as expected after the progress bar.
  • Verify that the modules can be recovered as expected.
  • Verify that there are no relevant console errors or network request failures.
  • Verify that there are no errors in the WP debug.log.
  • Verify this process with multiple recoverable modules.
  • Verify this process with both UA and GA4 connected, and also only GA4 (no UA) connected.

Changelog entry

  • Ensure Analytics module can be recovered when only GA4 is connected.
@techanvil techanvil added Module: Analytics Google Analytics module related issues P0 High priority Type: Bug Something isn't working labels Apr 12, 2023
@techanvil techanvil self-assigned this Apr 12, 2023
@techanvil techanvil removed their assignment Apr 12, 2023
@tofumatt tofumatt self-assigned this Apr 12, 2023
@tofumatt
Copy link
Collaborator

IB ✅

@tofumatt tofumatt removed their assignment Apr 12, 2023
@nfmohit nfmohit self-assigned this Apr 12, 2023
@nfmohit nfmohit removed their assignment Apr 14, 2023
@kuasha420 kuasha420 assigned kuasha420 and nfmohit and unassigned kuasha420 Apr 14, 2023
@nfmohit nfmohit assigned kuasha420 and unassigned nfmohit Apr 14, 2023
@kuasha420 kuasha420 assigned tofumatt and unassigned kuasha420 Apr 14, 2023
tofumatt added a commit that referenced this issue Apr 14, 2023
@tofumatt tofumatt removed their assignment Apr 14, 2023
@wpdarren wpdarren self-assigned this Apr 14, 2023
@wpdarren
Copy link
Collaborator

wpdarren commented Apr 14, 2023

QA Update: ⚠️

@nfmohit I have a few observations.

These are for a GA4 only site, no UA is set up.

  1. As the second admin user, I went to the Analytics settings and changed the GA4 property and disconnected Page Speed Insights. When I logged in as the first admin user, I saw the notice about Analytics 4 being disconnected but no mention of the second module, PSI that was disconnected. Is that expected? I did have PSI as a shared module from first admin.

image

You can see that PSI is not activated when I am logging in as the first admin.

image

  1. As the second admin user, I went to the settings and console API error appears. Module is not connected. This was without going into any settings, so is just the overview of the settings. This does not occur for the first admin user.

image

Thoughts, should this ticket be sent back to execution?

@nfmohit
Copy link
Collaborator

nfmohit commented Apr 17, 2023

  1. As the second admin user, I went to the Analytics settings and changed the GA4 property and disconnected Page Speed Insights.

Hi @wpdarren. When you say you "disconnected" PSI, may I know how you did it? If the module is entire disconnected from Site Kit, it won't be recoverable anymore and any other admin should be able to set it up from Site Kit again.

In order to test if PSI can be recovered, I think you need to disconnect the admin from Site Kit who set up PSI. That way, it will lose its owner ID and another admin will be able to recover it.

  1. As the second admin user, I went to the settings and console API error appears. Module is not connected. This was without going into any settings, so is just the overview of the settings. This does not occur for the first admin user.

I added some context behind this here. I'd recommend adding this to the bug bash board and creating a new issue for it.

@wpdarren
Copy link
Collaborator

wpdarren commented Apr 17, 2023

QA Update: ✅

Verified:

  • The modules can be recovered as expected.
  • There are no relevant console errors or network request failures.
  • There are no errors in the WP debug.log.
  • This process works with multiple recoverable modules.
  • This process with both UA and GA4 connected, and also only GA4 (no UA) connected.

image
image

Please see 2nd note above regarding an API error seen in the settings when logged in as the second admin user. I will be creating a ticket for this and adding it to the known issues board.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Exp: SP Module: Analytics Google Analytics module related issues P0 High priority Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants