question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

While analytics in 'gathering data' state, then clicking on 'Total clicks', 'Total impressions' or 'Unique visitors from search' throws error.

See original GitHub issue

Bug 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

  1. Create a new site which will have default gathering state.
  2. Activate the “zeroDataStates” feature flag
  3. Go to Site Kit Dashboard.
  4. Set up Analytics.
  5. Clicks on ‘Total clicks’, ‘Total impressions’ or ‘Unique visitors from search’.
  6. See Error.

Screenshots/Screencast

https://user-images.githubusercontent.com/94359491/159649263-5225b656-35ea-4060-a8c9-804c3a989b6b.mp4

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 DataBlock component should not call a callback passed via the handleStatSelection property on clicks or keys presses when in the data block is in the gathering data mode.
  • The cursor should show as disabled when hovering over such metrics.

Implementation Brief

  • Using assets/js/components/DataBlock.js,
    • Set the onClick and onKeyPress props to undefined if gatheringData is true to the googlesitekit-data-block element. Else keep the same values, i.e handleStatSelection && this.handleClick and handleStatSelection && this.handleKeyPress.
    • Add aria-disabled to the googlesitekit-data-block element if gatheringData is true.
    • Ensure the tabindex is set to -1 if gatheringData is true.
  • Using assets/sass/components/global/_googlesitekit-data-block.scss,
    • Add .googlesitekit-data-block--is-gathering-data and set cursor: 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 the googlesitekit-data-block--is-gathering-data class.
      &--button-#{$button}:not(.googlesitekit-data-block--is-gathering-data) {
      

Test Coverage

  • No new tests to be added.

QA Brief

  1. Create a new site which will have default gathering state.
  2. Activate the “zeroDataStates” feature flag
  3. Go to Site Kit Dashboard.
  4. Set up Analytics.
  5. ‘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:closed
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

2reactions
techanvilcommented, Apr 6, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found