Graph Output Issues on 'Unique Visitors from Search' data within SK Dashboard URL-Specific Pages
See original GitHub issueBug 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:
- When there is just 1 visitor from search, the graph does not fully display.
- When you have a single digit value from search, the graph looks in a zero state.
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
- Create new function
- 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 thecore/user
datastore via thegetDateRangeNumberOfDays
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 thecompareStartDate
andendDate
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 thesparkLineData
array with the date and a value of0
.
- Check if the number of rows in
Test Coverage
- Tests for the
getDatesBetween
function
Visual Regression Changes
- N/A
QA Brief
Changelog entry
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (5 by maintainers)
Top 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 >
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
Sounds good @felixarntz . @wpdarren Can you check again once #4237 has been merged?
@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.