Compare periods — performance over time

Last updated: May 19, 2026

Compare periods — performance over time

GET /api/v1/analytics/comparison (verified apps/backend/src/routes/api/analytics/comparison.route.ts). Query: current_since, current_until, previous_since, previous_until, platforms, target_currency. Returns per-metric delta_pct alongside baseline current values. UI: toggle Compare to previous period or pick a custom previous range. Standard pairs: last_7d vs prior_7d, MoM (month-over-month), YoY (year-over-year).

Who is this for

Anyone reading "is this getting better or worse?" — the most common analytics question after "what's the number now?".

How comparison works

You provide two date ranges:

Range

Purpose

Current period

The period you're focused on now (e.g. last 7 days)

Previous period

The baseline for comparison (e.g. the 7 days before that)

For each metric, the endpoint returns:

  • Current value

  • Previous value

  • delta_pct (% change current vs previous)

UI options

Toggle "Compare to previous period"

Top toolbar checkbox. Auto-derives previous_since/until from current_since/until:

  • Last 7 days → previous 7 days

  • Last 30 days → previous 30 days

  • Custom range → previous range of same length

Quick + auto.

Pick a custom previous range

For non-standard comparison (e.g. last 7 days vs same week last year):

  1. Click date range picker

  2. Set current_since / current_until

  3. Click Custom comparison → set previous_since / previous_until

  4. Apply

Useful for YoY when calendar weeks differ.

Standard comparison pairs

Comparison

Current

Previous

Use case

Week-over-week (WoW)

last_7d

prior_7d (8-14 days ago)

Weekly review

Month-over-month (MoM)

last_30d

prior_30d

Monthly review

Year-over-year (YoY)

last_30d

same period last year

Seasonality / growth

Quarter-over-quarter (QoQ)

last_90d

prior_90d (cap = 90d cross-channel limit)

Quarterly review

How delta is rendered

Each metric in the KPI strip / widgets shows:

  • Current value (large)

  • delta_pct (small, colored)

Color direction depends on the metric:

Metric

Green direction

spend, impressions, clicks, conversions, purchases, revenue, ROAS

Up

CPC, CPM, CPA, frequency

Down (cheaper / lower fatigue)

CTR

Up

(Same as KPI strip color conventions per an-106.)

Period length matters

Match period length to comparison intent:

Period length

Reactivity

Noise

1-3 days

High

High

7 days

Balanced

Moderate

14 days

Stable

Low (recommended for ROAS)

30 days

Smooth

Very low

90 days

Trend signal

Slow to react

For ROAS comparisons: 7 days minimum (postback lag). For pace comparisons (CTR, spend): 1-3 days OK. For executive monthly: 30 days.

Caveats

Postback lag affects "current" period

If current_until is today: postback metrics (purchases, ROAS, CPA) are incomplete. Delta_pct may swing significantly in the next 24-72h as data settles.

For decision-grade comparisons: end current_until 2-3 days ago.

Seasonal pairs need YoY

Comparing last 7d (mid-November) to prior 7d misses the Black Friday seasonal effect.

For seasonal businesses: pair with same period last year (YoY) for fair comparison.

Cross-Channel 90-day cap

Each period is capped at 90 days. Combined: comparison spans up to 180 days total but each side ≤ 90.

Currency stability

target_currency applies to both periods. FX rate variation between periods can introduce minor noise — generally < 1-2% for major currency pairs.

Use cases

Monday weekly review

  • Set current_since/until = last_7d

  • Enable Compare to previous period (auto = prior 7d)

  • Read delta_pct on KPI strip + channel comparison

  • Action: shift budget toward improving platforms; investigate declining ones

Monthly executive report

  • Set current_since/until = last_30d

  • Compare to previous period (prior 30d)

  • Export PDF with delta_pct visible

  • Annotate with commentary

MoM YoY combined

  • Show last month delta_pct vs prior month

  • Then show same month YoY (vs 12 months ago)

  • Captures growth trajectory + seasonality

Pre-meeting prep

Before stakeholder meeting: open Cross-Channel comparison → export PDF / CSV → annotate with talking points.

Endpoint

GET /api/v1/analytics/comparison (verified):

Query params:

  • current_since, current_until (required)

  • previous_since, previous_until (required for custom; UI auto-derives if "Compare to previous" enabled)

  • platforms (array)

  • target_currency

Returns per-metric current value + previous value + delta_pct.

How it relates to Ads Manager comparison

Ads Manager (PRD-16) also has a comparison toggle (am-120). Differences:

Aspect

Analytics comparison

Ads Manager comparison

Scope

Aggregated / rolled-up

Row-level per-entity

View

KPI strip / matrix / blocks

Grid with per-row delta

Decision intent

Strategic (allocate, scale)

Tactical (pause specific entity, scale specific entity)

Performance impact

Lower (rolled-up)

Higher (per-row)

Use both: Analytics for direction, Ads Manager for action.

Common mistakes

  • Comparing 7d vs 30d: different period lengths = misleading deltas. Match lengths.

  • YoY with calendar mismatch: same dates ≠ same shopping week (e.g. Black Friday shifts). Use ISO-week pairing.

  • Reading delta_pct on incomplete current period: postback lag falsifies "current". End 2-3 days ago for ROAS decisions.

  • Ignoring base value with high delta_pct: +500% from €10 to €60 is not the same as +500% from €1.000 to €6.000. Read both.

  • Color interpretation without metric awareness: down on CPC = good (cheaper); down on ROAS = bad. Check direction per metric.

Related