Skip to content
☁️ HitKeep Cloud is coming! Join the Early Access waitlist →

Period-over-Period Comparison

HitKeep automatically compares your current date range against the equivalent prior period on every analytics page. Delta badges appear on all KPI cards and a dashed overlay series appears on every timeseries chart — no toggle required.

Comparison is always active. Whenever you load or change the date range:

  1. HitKeep computes the previous period — a window of the same duration ending the millisecond before your current range begins.
  2. KPI cards show a +X.X% or -X.X% badge against the prior period.
  3. Timeseries charts gain dashed overlay series for the previous period.
  4. A “vs. Jan 24 – Feb 22” label appears near the range selector so you always know what you are comparing against.

HitKeep shifts the selected window backwards by its own duration:

Current rangeComparison range
Last 24 hours24 hours before that
Last 7 daysThe 7 days before that
Last 30 daysThe 30 days before that
Last yearThe year before that
Custom (Jan 25 – Feb 23)Equivalent length ending Jan 24

Comparison data is shown on:

  • Dashboard — all 5 traffic KPI cards + traffic chart overlay
  • Goals — Conversions, Conversion Rate, Unique Sessions + chart overlay
  • Funnels — Entries, Completions, Completion Rate + chart overlay
  • UTM — all 5 UTM hit-count cards (Campaign, Content, Medium, Source, Term)

The Events page does not show comparison — event property breakdowns are snapshots rather than trends.

The comparison object is always present in the stats endpoint response. The previous period is computed server-side from the from / to parameters you supply:

Terminal window
curl "https://your-hitkeep.example/api/sites/{id}/stats?\
from=2025-02-01T00:00:00Z&to=2025-02-28T23:59:59Z" \
-b "hk_token=YOUR_SESSION_COOKIE"

The response includes a comparison object covering the equivalent prior period:

{
"total_pageviews": 4200,
"unique_sessions": 1800,
"comparison": {
"total_pageviews": 3500,
"unique_sessions": 1500,
"utm_campaign_hits": 210,
"utm_content_hits": 80,
"utm_medium_hits": 310,
"utm_source_hits": 420,
"utm_term_hits": 55,
"goals": [
{ "goal_id": "...", "name": "Signup", "conversions": 140, "conversion_rate": 9.3 }
],
"total_conversions": 140,
"chart_data": [...]
}
}

You may also pass explicit comparison bounds using compare_from / compare_to if you need a custom window:

Terminal window
curl "https://your-hitkeep.example/api/sites/{id}/stats?\
from=2025-02-01T00:00:00Z&to=2025-02-28T23:59:59Z&\
compare_from=2025-01-01T00:00:00Z&compare_to=2025-01-31T23:59:59Z" \
-b "hk_token=YOUR_SESSION_COOKIE"