how do i get "peak engagement time" by hour in mixpanel?
There are a couple of approaches in Mixpanel to find peak engagement time by hour:
1. Using the Frequency Report (UI)
The Frequency report (found under Retention) lets you analyze how frequently users engage with events across time buckets. You can set the granularity to hour (addiction_unit = "hour") within a day (unit = "day"). This shows how many unique hours in a day users performed a given event, helping you identify when engagement peaks. [Frequency View]
2. Using the Query API (Programmatic)
You can use the Frequency Query API endpoint to get hourly engagement data:
GET /retention/addictionWith these parameters:
unit=day โ the overall time period
addiction_unit=hour โ granularity broken down by hour
This returns an array of 24 values per day, where each index represents how many users were active in at least that many unique hours. For example, the first value is users active in at least 1 hour, the second in at least 2 hours, etc. [Query Frequency Report]
3. Using Insights with Minute/Hour Granularity
In the Insights report, you can set the date range to a custom window and enable hourly granularity to see event counts broken down by hour of the day. This lets you visually identify which hours have the highest event volume. [Minute Level Granularity]
Which approach is best? If you want a quick visual, use Insights with hourly granularity. If you want programmatic access or want to analyze patterns across many days, the Frequency Query API with addiction_unit=hour is the most direct fit.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
in the retention part, it says that 'hour is not available for retention'? kapa.ai
You're right to flag that. Looking at the Retention Query API documentation more carefully, the unit parameter for the standard retention endpoint only supports "day", "week", or "month" โ hour is not an option there. [Query Retention Report]
However, the Frequency Report endpoint (GET /retention/addiction) is a separate endpoint that does support addiction_unit=hour. This is not the same as standard retention โ it measures how many unique hours in a day users performed an event, which is a frequency/engagement metric rather than a traditional retention calculation. [Query Frequency Report]
So to clarify my previous answer:
Standard Retention (GET /retention): Hour is not available as a unit.
Frequency Report (GET /retention/addiction): Hour is available as addiction_unit, and this is the right endpoint for understanding peak engagement by hour.
If your goal is specifically to find peak engagement time by hour, the Frequency endpoint (/retention/addiction with unit=day and addiction_unit=hour) is the appropriate tool.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
kapa.ai but this is not there on the gui right? it's a code-based dev change?
Actually, the Frequency report is available in the Mixpanel UI. According to the documentation, you can access it by clicking Reports โ Retention, then selecting the Frequency option under the toggle for retention. [Frequency View]
However, the UI version lets you choose intervals like "unique hours in a day", "unique days in a week", or "unique days in a month" โ so the hourly breakdown is accessible without any code.
The Query API (GET /retention/addiction) is simply the programmatic equivalent if you need to pull that data into your own systems or automate analysis.
So to summarize:
GUI: Yes, available under Retention โ Frequency toggle.
API: Also available via GET /retention/addiction for code-based/programmatic access.
โน๏ธย Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
