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

WP dashboard widget invokes requests for UA reports in GA4 mode #7306

Closed
aaemnnosttv opened this issue Jul 13, 2023 · 5 comments
Closed

WP dashboard widget invokes requests for UA reports in GA4 mode #7306

aaemnnosttv opened this issue Jul 13, 2023 · 5 comments
Labels
Module: Analytics Google Analytics module related issues P0 High priority Type: Bug Something isn't working

Comments

@aaemnnosttv
Copy link
Collaborator

aaemnnosttv commented Jul 13, 2023

Bug Description

The WP dashboard widget ("Site Kit Summary"), like the SK dashboard conditionally shows GA4 versions of its Analytics widgets based on the configured dashboard view.

1.104.0 included changes to the way one a relevant selector worked which causes this issue.

If UA is connected, this results in some extra requests being made which aren't really being used. If UA is not connected, these result in extra requests that all fail and because of this are made on every navigation to the WP dashboard, which is not great.

Steps to reproduce

  1. Connect GA4, with no UA
  2. Visit WP dashboard
  3. See errors in console

Screenshots

image

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

Acceptance criteria

  • The WP dashboard widget should only request Analytics data based on the configured dashboard view
    • If the dashboard view is UA, no requests should be made for GA4 reports
    • If the dashboard view is GA4, no requests should be made for UA reports

Implementation Brief

  • Update conditions for rendering UA components based on the dashboard view to use a strict comparison, rather than a loose one which can return a momentary false positive while loading
  • Merge Fix UA side-effect on WP dashboard #7307

Test Coverage

  • No changes necessary

QA Brief

  • The changes described above are isolated to the WP dashboard widget
  • The PR above also corrects the same kind of change with the date marker for indicating when UA stopped collecting data, although this is almost not worth mentioning

Changelog entry

  • Fix bug that additionally requested UA Analytics reports on the WP dashboard when dashboard view was set to GA4.
@aaemnnosttv aaemnnosttv added Type: Bug Something isn't working P0 High priority Module: Analytics Google Analytics module related issues labels Jul 13, 2023
@aaemnnosttv aaemnnosttv self-assigned this Jul 13, 2023
@aaemnnosttv aaemnnosttv removed their assignment Jul 13, 2023
@tofumatt tofumatt self-assigned this Jul 13, 2023
@tofumatt
Copy link
Collaborator

IB ✅

@mohitwp
Copy link
Collaborator

mohitwp commented Jul 14, 2023

@wpdarren I'm not able to reproduce issue on latest environment. Not getting console errors on WP dashboard.

  • Tested using new site having only Ga4 property.
  • Also, tested using Oi.ie site by connecting only GA4 property.
  • Tested after enabling and disabling UA property.
  • Tested on 7.4 and 8.1 PHP versions.
Recording.453.mp4
Recording.454.mp4

@wpdarren
Copy link
Collaborator

wpdarren commented Jul 14, 2023

@mohitwp I do see the errors but I have to say that they do not appear all the time for me. I had to refresh a few times for them to appear. I also had to wait for 30-60 seconds for them to appear and for the Site Kit widget to fully load. I used oi.ie and made sure that the UA property was not enabled. Just GA4.

I would hold off testing this though, as I want to make sure the change has been merged.

image

@wpdarren wpdarren removed their assignment Jul 14, 2023
@mohitwp mohitwp assigned wpdarren and unassigned mohitwp Jul 14, 2023
@wpdarren
Copy link
Collaborator

QA Update: ✅

Verified:

The errors no longer appear in the console when you only have a GA4 property connected. As you see from the screencast below, the error messages initially appeared on 1.104.0 and when I switched to the main branch they no longer appear.

dashboard.mp4

@wpdarren wpdarren removed their assignment Jul 14, 2023
@aaemnnosttv
Copy link
Collaborator Author

@wpdarren I'm not able to reproduce issue on latest environment. Not getting console errors on WP dashboard.

@mohitwp thanks for sharing this. I found that the error only happens when the dashboard widget is in view on page load. In your screencast it's below the fold and in Darren's it's above it. The reports are only requested when the widget is in view, so when it's delayed like this the data that's not available yet (and the cause for the UA version to be invoked) becomes available before the widget is rendered.

If you move the widget to the top of the dashboard so that its in view and reload, you'll should see the errors.

Thanks for the collaboration on this one all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants