[Enhancement]: Analytics compare options should fit the selected date range
Describe the solution you'd like
Analytics offers two comparison options, "Previous period" and "Previous year". On my own store I keep wanting a third question answered: how is today doing against the same day last week, or the same day last month. Daily traffic has a strong weekday shape, so "Previous period" (yesterday) is often the least useful of the three.
The current pair also overlaps on some ranges. With "Month to date" selected, "Previous period" already means the previous month, so a plain "Previous month" option would be the same dates under a different name.
What I would like instead is a comparison list that depends on the selected range, offering the previous range of the same unit plus the same range in a larger unit:
| Selected range | Compare to |
|---|---|
| Today, Yesterday, single custom day | Previous day, Same day last week, Same day last month, Same day last year |
| Week to date, Last week | Previous week, Same week last year |
| Month to date, Last month | Previous month, Same month last year |
| Quarter to date, Last quarter | Previous quarter, Same quarter last year |
| Year to date, Last year | Previous year |
I have a working branch for this and will open a draft PR that links back to this issue, so the option set and the labels can be discussed on real UI rather than in the abstract.
Describe alternatives you've considered
- Adding a fixed "Previous month" option to the existing list. Simpler, but it duplicates "Previous period" on month ranges and does nothing for week or quarter ranges.
- Doing this only in the mobile apps. The apps have no comparison picker at all, and the option list would still have to be decided here first.
- Leaving week ranges with a month comparison as well. I dropped that on purpose: a week shifted back by one month starts on a different weekday, and weekday shape is the reason for comparing weeks. GA4 and Squarespace both align comparisons to weekdays.
Additional context
How other platforms handle the same picker:
- Shopify: "Previous period", "Previous year", custom, and no comparison in the admin. Its query language also supports
previous_day,previous_week,previous_month,previous_quarterandprevious_year_match_day_of_week. - Google Analytics 4: "Previous period", "Previous period (match day of week)", "Previous year".
- Squarespace: no picker at all. The length of the range decides the comparison, and it always keeps the same weekdays.
- Wix: "None", "Previous period", "Previous year".
Two related things I ran into while looking at this, both out of scope here:
- wp-admin compares an unfinished range against the full earlier range, while the Woo mobile apps, Shopify and BigCommerce compare only up to the same time of day. That is why the app and wp-admin show very different percentages for "Today" on the same store.
- #46218 asks for a way to turn the comparison off. A "No comparison" entry would fit the same list.
Source: woocommerce/woocommerce