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.

Graph Output Issues on 'Unique Visitors from Search' data within SK Dashboard URL-Specific Pages

See original GitHub issue

Bug Description

While testing #1997 I noticed that the graph on the Site Dashboard URL-specific pages, underneath the Unique Visitors from Search is not functioning. Initially, I thought it might be related to the ticket, but could recreate the issue on the latest version (1.37.0). There are two issues that occur with the graph as detailed:

  1. When there is just 1 visitor from search, the graph does not fully display.

image.png

  1. When you have a single digit value from search, the graph looks in a zero state.

image.png


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

Acceptance criteria

  • The Analytics “Unique Visitors from Search” widget should render an accurate sparkline also in case there are fewer than 10 users. Right now the line in that case is flat (see screenshot above), when a few bumps of 1-2 users a day should probably be expected.
    • This may have some overlap with #4237, so make sure to cross-check (although that issue is purely focused on fixing the sparkline for the case of 0 visitors).

Implementation Brief

  • Create assets/js/util/date.js which contains date related utility functions.
    • Create new function getDatesBetween which returns an array of dates between 2 given dates. It should accept 2 mandatory parameters:
      • startDate
      • endDate
  • Using assets/js/modules/analytics/components/dashboard/DashboardSearchVisitorsWidget.js,
    • Check if the number of rows in sparkLineData (exclusing the first line item which is the header) is less than the number of dates between the user selected range. This can be obtained by querying the core/user datastore via the getDateRangeNumberOfDays selector.
    • If it is less, it means that for some dates there are no data. Thus, call the getDatesBetween function to generate all the dates, passing the compareStartDate and endDate as parameters.
    • Loop through the array of dates and check if there is a value for the currently iterated date in the sparkLineData array.
    • In the date is not present in sparkLineData, add a new line item to the sparkLineData array with the date and a value of 0.

Test Coverage

  • Tests for the getDatesBetween function

Visual Regression Changes

  • N/A

QA Brief

Changelog entry

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
asvinbcommented, Nov 17, 2021

Sounds good @felixarntz . @wpdarren Can you check again once #4237 has been merged?

1reaction
felixarntzcommented, Nov 3, 2021

@asvinb @wpdarren While debugging #4237 I found a solution for that problem, which could possibly solve the issue here as well. Since it’s a rather obscure problem, maybe we should implement the fix there first and see whether it resolves the issue here too.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Line chart not appearing for 'Unique Visitors From Search' widget on ...
felixarntz mentioned this issue on Oct 27, 2021. Graph Output Issues on 'Unique Visitors from Search' data within SK Dashboard URL-Specific Pages #3774....
Read more >
How to Understand Unique Visitors in Google Analytics
In Analytics, click on Audience in the top left of the page and then on Overview. The graph at the top will show...
Read more >
View usage data for SharePoint pages and news
Usage data for Page viewers, Page views, and Average time spent per user is ... On the right-hand side of the graph, you'll...
Read more >
2.2.1 - Visitors (Page Views, Unique Visitors, etc) - YouTube
First thing you will see in the app there are three metrics next to each other: visitors, unique visitors and page visits.
Read more >
Untitled
Types of protective equipment in sport, Silencieux 206 2.0 hdi, Coach and horses kew ... Hdmi output not working on xbox 360, Nahu...
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