Cohort Analysis
Compare a metric across user cohorts defined by join date or property value.
Overview
Cohort Analysis groups users into cohorts — either by when they first did something (time-based) or by a static property value (e.g. plan tier) — and then compares a metric across those cohorts. Use it to answer "do users who joined in January behave differently to February signups?" or "how does purchase frequency differ across plan tiers?"
When to use cohort: "Do users who signed up in January spend more than February signups?", "Compare engagement by plan tier", "Show LTV curves by acquisition month."
When NOT to use cohort: If you want period-by-period return rates for a single cohort, use
retention. If you want a plain time-series count, use trend.
Configuration Reference
Prop
Type
CohortByFirstEvent Properties
Groups users by the calendar period of their first occurrence of a specific event.
Prop
Type
CohortByProperty Properties
Groups users by a static event property value (e.g. their plan at signup).
Prop
Type
CohortAggregation values
| Value | Meaning |
|---|---|
"count" | Total event occurrences in the cohort |
"uniqueUsers" | Unique users in the cohort who fired the metric event |
"avg" | Average value of a numeric property (requires sumProperty) |
"sum" | Sum of a numeric property (requires sumProperty) |
Available Template Variables
| Variable | Description |
|---|---|
{{cohortCount}} | Number of cohorts included in the analysis |
{{avgCohortSize}} | Average number of users per cohort |
{{cohortSummary}} | Per-cohort metric table (cohort label, size, metric value) |
{{windowPeriod}} | Human-readable analysis window, e.g. "last 90 days" |
{{dataAsJson}} | Full structured result as JSON |
{{executedAt}} | ISO 8601 execution timestamp |
Example
apiVersion: journium.app/v0Beta
kind: InsightTracker
metadata:
name: weekly-cohort-purchases
displayName: Weekly Signup Cohort → Purchase Comparison
description: Compare purchase rates across weekly signup cohorts
spec:
type: LLM
trigger:
mode: automatic
schedule: weekly
window:
period: last_90d
analysis:
type: cohort
entity: person_id
cohortDefinition:
firstEvent: user_signed_up
period: week
metric:
event: purchase_completed
aggregation: uniqueUsers
maxCohorts: 12
llm:
promptTemplate: |
Weekly cohort analysis for {{windowPeriod}}.
{{cohortCount}} cohorts included. Average cohort size: {{avgCohortSize}} users.
Cohort comparison:
{{cohortSummary}}
Full data: {{dataAsJson}}
Identify which signup cohorts have the highest purchase rates and what might explain the difference.
maxOutputTokens: 400How is this guide?
Last updated on