Docs
De docs doorbladeren

Date ranges and comparisons

Pick date range presets or custom dates, compare with the previous period or the same period last year, and choose chart intervals, all in the site's timezone.

Als Markdown bekijken

Presets#

The date menu in the toolbar lists every preset, then two date fields and Apply range for a custom range.

Preset API value Range
Today today Midnight to midnight today
Yesterday yesterday The whole of yesterday
Last 24 hours 24h A rolling window that ends now
Last 7 / 14 / 28 / 30 / 90 days 7d, 14d, 28d, 30d, 90d That many calendar days, including today
Month to date mtd The 1st of this month through today
Last month last_month The previous calendar month
Quarter to date qtd The first day of this quarter through today
Last quarter last_quarter The previous calendar quarter
Year to date ytd January 1 through today
Last 12 months 12mo The 12 months that end today
Last calendar year last_year January 1 to December 31 of last year
All time all From the first tracked event, or the first imported day if that is earlier, through today
Custom range custom with from and to Both dates included (YYYY-MM-DD). A missing from means 29 days before today, a missing to means today

The default is Last 7 days. Some presets have a keyboard shortcut, shown next to them in the menu.

Timezone#

Ranges are calendar days in the site's timezone (Site settings → General), which is shown next to the range on the Overview. Data is stored in UTC, so changing the timezone re-buckets history. See Timezones.

Comparisons#

Compare in the toolbar turns the previous period on and off. While it is on, vs last year switches to the same period last year.

Option API value What it compares with
Off compare=none Nothing (the default)
Previous period compare=previous_period The period of the same length that ends where this one starts
Same period last year compare=previous_year The same dates one year earlier
Custom compare=custom with compare_from and compare_to Any range you give (both dates included). URL and API only
Match day of week match_weekday=true Shifts the comparison by whole weeks (previous period) or by 52 weeks (previous year), so Mondays are compared with Mondays. URL and API only

Intervals#

The buttons on the main chart offer Hour, Day, Week and Month. The API takes interval:

Value What it does
auto Hours for a range of one day or less, days up to 92 days, weeks up to 366 days and months beyond (the default)
minute One point per minute. Ranges of one day or less
hour One point per hour. Ranges of up to 14 days
day, week, month, quarter, year One point per day, week, month, quarter or year

An interval that is too fine for the range falls back to auto.