Compare periods — performance over time

GET /api/v1/analytics/comparison. current vs previous date ranges → per-metric delta_pct. Common pairs: last 7d vs prior 7d, MoM, YoY.

Written By Salvatore Sinigaglia

Last updated About 4 hours ago

GET /api/v1/analytics/comparison. current vs previous date ranges → per-metric delta_pct. Common pairs: last 7d vs prior 7d, MoM, YoY.

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 (dates YYYY-MM-DD), platforms, target_currency. Returns per-metric delta_pct alongside baseline current values. This endpoint is cross-channel-gated: it returns 404 if ENABLE_CROSS_CHANNEL_ANALYTICS is off. In Analytics the compare feature is active (the Compare to previous period toggle drives it); in Ads Manager the equivalent comparison is currently disabled (am-120). 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:

RangePurpose
Current periodThe period you're focused on now (e.g. last 7 days)
Previous periodThe 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

ComparisonCurrentPreviousUse case
Week-over-week (WoW)last_7dprior_7d (8-14 days ago)Weekly review
Month-over-month (MoM)last_30dprior_30dMonthly review
Year-over-year (YoY)last_30dsame period last yearSeasonality / growth
Quarter-over-quarter (QoQ)last_90dprior_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:

MetricGreen direction
spend, impressions, clicks, conversions, purchases, revenue, ROASUp
CPC, CPM, CPA, frequencyDown (cheaper / lower fatigue)
CTRUp

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

Period length matters

Match period length to comparison intent:

Period lengthReactivityNoise
1-3 daysHighHigh
7 daysBalancedModerate
14 daysStableLow (recommended for ROAS)
30 daysSmoothVery low
90 daysTrend signalSlow 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:

AspectAnalytics comparisonAds Manager comparison
ScopeAggregated / rolled-upRow-level per-entity
ViewKPI strip / matrix / blocksGrid with per-row delta
Decision intentStrategic (allocate, scale)Tactical (pause specific entity, scale specific entity)
Performance impactLower (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.

FAQ

How do I compare two periods in Wevion analytics?

Enable the Compare to previous period toggle in the top toolbar, which auto-derives the previous range from your current one (last 7 days becomes the prior 7 days). For non-standard comparisons, use the date range picker's Custom comparison to set previous_since and previous_until manually, useful for year-over-year when calendar weeks differ.

What does delta_pct mean and how is it colored?

Wevion's comparison returns delta_pct, the percentage change of the current period versus the previous one, shown small and colored next to each metric. The color direction depends on the metric: up is green for spend, conversions, revenue, ROAS, and CTR, while down is green for CPC, CPM, CPA, and frequency because cheaper or lower fatigue is better.

What are the standard comparison pairs?

Wevion supports week-over-week (last_7d vs the prior 7 days), month-over-month (last_30d vs prior_30d), year-over-year (last_30d vs the same period last year for seasonality), and quarter-over-quarter (last_90d vs prior_90d, capped at the 90-day cross-channel limit). Match period lengths so deltas stay meaningful.

Why is my delta_pct swinging on the current period?

Because postback metrics like purchases, ROAS, and CPA are incomplete when current_until is today, and delta_pct can shift significantly over the next 24-72 hours as data settles. For decision-grade comparisons, end current_until two or three days ago, and use at least a 7-day period for ROAS.

Should I use Analytics comparison or Ads Manager comparison?

Use both for different jobs. Wevion's Analytics comparison is aggregated and strategic, driving allocation and scale decisions across the KPI strip, matrix, and blocks. Ads Manager comparison is row-level and tactical, showing per-entity deltas so you can pause or scale a specific entity. Analytics gives direction; Ads Manager drives the action.