While analytics in 'gathering data' state, then clicking on 'Total clicks', 'Total impressions' or 'Unique visitors from search' throws error.
See original GitHub issueBug Description
While Analytics in gathering state, then clicking on Total clicks’, ‘Total impressions’ or ‘Unique visitors from search’ throws error. Suggestion: We can disable click on cards while analytics is in gathering data state.
Cannot read properties of null (reading '__eventTarget')
in GoogleChart
in div
in Cell
in div
in Row
in div
in ForwardRef
in AnalyticsStats
in div
in div
in Widget
in WithWidgetSlug(Widget)
in SearchFunnelWidget
in WidgetRenderer
in div
in Cell
in WidgetCellWrapper
in div
in Row
in div
in div
in ForwardRef
in WidgetAreaRenderer
in div
in WidgetContextRenderer
in DashboardEntityApp
in GoogleSitekitDashboardDetails
in RestoreSnapshots
in ErrorHandler
in Root
Steps to reproduce
- Create a new site which will have default gathering state.
- Activate the “zeroDataStates” feature flag
- Go to Site Kit Dashboard.
- Set up Analytics.
- Clicks on ‘Total clicks’, ‘Total impressions’ or ‘Unique visitors from search’.
- See Error.
Screenshots/Screencast
Additional Context
- PHP Version:
- OS: [e.g. iOS]
- Browser: [e.g. chrome, safari]
- Plugin Version: [e.g. 22]
- Device: [e.g. iPhone6]
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- Metrics in the Search traffic widget that say “gathering data” should not be selectable.
- The
DataBlockcomponent should not call a callback passed via thehandleStatSelectionproperty on clicks or keys presses when in the data block is in the gathering data mode.
- The
- The cursor should show as disabled when hovering over such metrics.
Implementation Brief
- Using
assets/js/components/DataBlock.js,- Set the
onClickandonKeyPressprops toundefinedifgatheringDataistrueto thegooglesitekit-data-blockelement. Else keep the same values, i.ehandleStatSelection && this.handleClickandhandleStatSelection && this.handleKeyPress. - Add
aria-disabledto thegooglesitekit-data-blockelement ifgatheringDataistrue. - Ensure the tabindex is set to
-1ifgatheringDataistrue.
- Set the
- Using
assets/sass/components/global/_googlesitekit-data-block.scss,- Add
.googlesitekit-data-block--is-gathering-dataand setcursor: auto. - Update the selector where the hover, focus and active styles are set to the
googlesitekit-data-block--button-*class names by excluding blocks having thegooglesitekit-data-block--is-gathering-dataclass.&--button-#{$button}:not(.googlesitekit-data-block--is-gathering-data) {
- Add
Test Coverage
- No new tests to be added.
QA Brief
- Create a new site which will have default gathering state.
- Activate the “zeroDataStates” feature flag
- Go to Site Kit Dashboard.
- Set up Analytics.
- ‘Total Impression’, ‘Total clicks’, ‘Total impressions’ or ‘Unique visitors from search’ from the SearchFunnel widget should not be clickable, hovered or tabbable.
Changelog entry
- Prevent selection of metrics in the Search Traffic widget when gathering data.
Issue Analytics
- State:
- Created a year ago
- Comments:11
Top Results From Across the Web
Performance report (Search) - Search Console Help
Depending on which tabs you select, the chart shows total clicks, total impressions, average CTR (click through rate), and average position for your...
Read more >Traffic analytics - Squarespace Help Center
The Traffic panel in analytics shows a summary of traffic and ... Click Unique visitors, Visits, or Pageviews to filter data by that...
Read more >29 Common Google Analytics Data Errors And How To Fix Them
Google Analytics data not showing all traffic or no view data? Here's why your data is wrong and how to fix the most...
Read more >Google Search Console vs Google Analytics - Kinsta
Click -through rate (CTR): Your CTR is the rate at which internet users see your website in search engine results and click on...
Read more >Frequently asked questions | Microsoft Learn
Clarity is a user behavior analytics tool that helps you understand how users ... How can I prevent Clarity from gathering data on...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi @wpdarren, I think you raise a good point, but I would suggest creating a new issue for this. The original bug report for this was clearly quite critical with an error being displayed on the page, hence the P0.
The question about whether to make the bar here grey is not as critical - and although I suspect we should, given it wasn’t captured in the AC/IB I think it would be OK to go through the usual process, I don’t think it needs to be rushed into the current release.
Created separate tickets for https://github.com/google/site-kit-wp/issues/4967#issuecomment-1091420787 and https://github.com/google/site-kit-wp/issues/4967#issuecomment-1090424456
https://github.com/google/site-kit-wp/issues/5056 https://github.com/google/site-kit-wp/issues/5057