Changes proposed in this Pull Request
Adds a simple stats card to the Customer Home that displays the current week views and visitors of the site.
![Screenshot 2020-01-22 at 14 08 15](https://user-images.githubusercontent.com/1233880/72896714-a7b31280-3d20-11ea-9dcb-8a226bb02615.png)
For sites that don’t reach 10 visits, we show insights indicating the most popular day and hour:
![Screenshot 2020-01-23 at 15 16 50](https://user-images.githubusercontent.com/1233880/72992454-0c8b6d00-3df4-11ea-910a-d3d33727d807.png)
The card is not displayed in the below scenarios:
- When the site is unlaunched.
- When the site is a Jetpack or Atomic site with the Stats module disabled.
- When the site has not received any visit yet (i.e. new created sites), since there is no popular day and time recorded.
Testing instructions
- Go to
/home/:site
.
- Verify there is a new “Stats at a glance” in the top of the right column.
- If your site has 10 visits or more for the current week, you should see the number of views and visitors. Make sure numbers match stats displayed in
/stats/week/:site
.
- If your site has less than 10 visits for the current week, you should see the most popular day and hour. Make sure data matches
/stats/insights/:site
.
- Make sure the card is not displayed for unlaunched sites.
- Make sure the card is not displayed for Jetpack or Atomic sites with the Stats module disabled (this can be done in Marketing > Traffic).
- Make sure the card is not displayed for sites without traffic yet (i.e. new created sites).
Fixes #38997
Unfortunately, no screenshots were provided by the developer.