Can you explain a step-by-step guide to start tracking session replay?
Hi Yanisa S., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> đź‘‹
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
Certainly! I can provide you with a step-by-step guide to start tracking session replay in Mixpanel. Here's how you can get started: 1. Ensure you have the latest version of Mixpanel SDK: For web applications, you need at least version 2.50.0 of the JavaScript SDK. For iOS applications, you need at least version 4.3.1 of the Swift SDK.2. Initialize Mixpanel with Session Replay enabled: For web applications:
"<YOUR_PROJECT_TOKEN> ",
{
record_sessions_percent: 1 //records 1% of all sessions
}
)
```LBKS [Mixpanel SDKs: Javascript](https://docs.mixpanel.com/docs/tracking-methods/sdks/javascript#session-replay)LBKS For iOS applications:
```LBKS let config = MPSessionReplayConfig(wifiOnly: false, recordSessionsPercent: 100.0)
let sessionReplayInstance = MPSessionReplay.initialize(token: Mixpanel.mainInstance().apiToken, distinctId: Mixpanel.mainInstance().distinctId, config: config)
```LBKS [Quick Start Guide](https://docs.mixpanel.com/docs/session-replay/session-replay-ios)LBKS3. Start recording:
For web applications, recording starts automatically based on the `record_sessions_percent` setting.LBKS For iOS applications, you need to explicitly start recording:
```LBKS MPSessionReplay.getInstance()?.startRecording()
```LBKS [Quick Start Guide](https://docs.mixpanel.com/docs/session-replay/session-replay-ios#enable-session-replay)LBKS4. (Optional) Configure additional options:
You can customize various aspects of Session Replay, such as masking sensitive information or setting idle timeouts. Refer to the documentation for specific options.LBKS5. Test your implementation:
Start with a low sampling rate (like 1%) and test in a demo project before rolling out to production.LBKS6. Monitor and adjust:
Keep an eye on performance and adjust the sampling rate or other settings as needed.LBKSRemember, before enabling Session Replay for a large audience, it's recommended to test in a demo project and start with smaller sets of users to monitor performance and ensure privacy rules align with company policies.LBKS[Session Replay](https://docs.mixpanel.com/docs/session-replay) provides more detailed information on implementation and best practices.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
You're correct in your understanding. Mixpanel's Session Replay feature does not record all sessions by default, but instead uses sampling to capture a subset of sessions. This sampling approach is designed to balance data collection with performance and resource considerations.The sampling rate is controlled by the record_sessions_percent
parameter during SDK initialization. For example: LBKSmixpanel.init( "<YOUR_PROJECT_TOKEN> ", { record_sessions_percent: 1 //records 1% of all sessions } )LBKS
Mixpanel SDKs: JavascriptThis setting means that only 1% of all sessions will be recorded. You can adjust this percentage based on your needs and resources. Setting it to 100 would record all sessions, but this is generally not recommended for production environments due to potential performance impacts and data volume considerations.Mixpanel recommends starting with a low sampling rate, such as 1%, and then adjusting it according to your specific analytics needs and the performance of your application. This approach allows you to gather meaningful insights while managing the impact on your application and infrastructure.Session Replay Q&A with Mixpanel Senior Product Manager DJ Satoda provides additional insights on sampling recommendations for different use cases. For instance, for debugging or monitoring new features, they don't recommend sampling at all to ensure you capture all relevant sessions.Remember, you can always adjust the sampling rate to find the right balance between data collection and performance for your specific use case.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
Your understanding is not entirely correct. Let me clarify how Mixpanel's Session Replay works with regards to storage and access limits: Mixpanel does not store all recorded sessions beyond your plan's limit. According to the documentation: "Customers will be blocked from viewing additional replays above their monthly limit (or custom add-on limit for an Enterprise plan) until they upgrade or purchase additional volumes. After breaching a higher limit, we may stop capturing replays of your user sessions."Session ReplayThis means that if you're on a Growth or Enterprise plan with 20k free replays per month, Mixpanel will only capture and store up to 20k replays. Once you reach this limit, Mixpanel will stop capturing new replays for that month.In your hypothetical scenario of 100k sessions, Mixpanel would not store all 100k sessions. It would only capture and store the first 20k replays, and then stop capturing additional replays for that month.It's also worth noting that for customers who have purchased additional Session Replay capacity as an add-on (available for Enterprise plans), there's a different behavior: "For customers who have purchased our Session Replay add-on, you will be billed for replays ingested beyond your purchased amount at the per unit rate."Session ReplayIn this case, Mixpanel would continue capturing replays beyond the initial limit, but at an additional cost.To manage your replay capture effectively, it's recommended to monitor your usage and adjust your sampling rate if necessary. If you find that you consistently need more than 20k replays per month, you might want to consider upgrading your plan or purchasing additional capacity if you're on an Enterprise plan.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
Yes, you can specify only certain screens or parts of your application to be recorded in Mixpanel's Session Replay. This level of control allows you to focus on specific areas of interest while avoiding recording sensitive information. Here's how you can achieve this: For web applications: 1. You can use the start_session_recording()
and stop_session_recording()
methods to control when recording happens. For example: LBKS// Start recording when entering a specific screen mixpanel.start_session_recording()LBKS// Stop recording when leaving the screen mixpanel.stop_session_recording()LBKS
Mixpanel SDKs: Javascript2. You can also use these methods in combination with your application logic to record only certain types of users or features: LBKS// Example: Record only for users using a specific feature if (userIsUsingSpecificFeature) { mixpanel.start_session_recording() }LBKS
For iOS applications: You can use similar methods to start and stop recording at specific points in your app: LBKS// Start recording MPSessionReplay.getInstance()?.startRecording()LBKS// Stop recording MPSessionReplay.getInstance()?.stopRecording()LBKS
Quick Start GuideThe documentation provides some example scenarios: 1. For sensitive screens: "When user is about to access the sensitive screen, call mixpanel.stop_session_recording()
. To resume recording once they leave this screen, you can resume recording with mixpanel.start_session_recording()
"2. For specific features: "When user is about to access the feature you wish to capture replays for, call mixpanel.start_session_recording()
to force recording on"Mixpanel SDKs: JavascriptBy using these methods, you can effectively control which parts of your application are recorded, allowing you to focus on the most relevant areas for your analysis while respecting user privacy and optimizing resource usage.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
Yes, Mixpanel can record sessions on both websites and mobile applications, but there are some differences in availability and implementation: For websites: Session Replay is fully available for web-based applications, including mobile web. You can implement it using the JavaScript SDK.Session Replay states: "We currently support two platforms: Web iOS (Alpha)"For mobile applications: 1. iOS: Session Replay is currently in Alpha testing for native iOS apps. Session Replay mentions: "iOS (Alpha)"2. Android: Session Replay is not yet available, but it's in the pipeline. According to the FAQ: "Android Alpha testing is expected in early 2025."It's important to note that the implementation and capabilities may differ between web and mobile platforms. For web applications, Session Replay is more established and fully featured. For mobile applications, especially iOS, it's still in early stages (Alpha) and may have limitations or be subject to changes.If you're interested in using Session Replay for mobile applications, especially for iOS, you should contact your Mixpanel Account Manager for the most up-to-date information and access to the Alpha version.Session Replay Q&A with Mixpanel Senior Product Manager DJ Satoda provides more insights into the implementation and use cases for different platforms.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
To answer your question about how Mixpanel counts the quota for Session Replay, let's look at how sessions are defined and counted: 1. Session Definition:
According to the documentation, Mixpanel uses a timeout-based session by default: "A Timeout-Based Session in Mixpanel is defined as a group of events one user performs within a given time frame on your website or app. A session starts when a user performs an event that is not excluded from your Sessions Settings." Sessions: Compute sessions based on existing event data2. Session Timeout:
"The default length is 30 minutes." Sessions: Compute sessions based on existing event data3. Counting Sessions:
In your example, where a user logs in and performs multiple events within 15 minutes, this would count as a single session in the 20k quota bucket. This is because all these events fall within the default 30-minute timeout period.4. Replay Counting:
It's important to note that the quota is counted based on replays, not sessions. Each replay of a session counts towards your quota, regardless of the session's length or number of events. "Customers on the Growth and Enterprise plans have access to 20k free replays per month." Session ReplaySo, in your example, if this user's session is captured for replay (which depends on your sampling settings), it would count as 1 replay towards your 20k monthly quota, regardless of how many events occurred within that 15-minute period.Remember, the actual number of sessions captured depends on your sampling rate: "The sampling rate is controlled by the record_sessions_percent
parameter during SDK initialization."Mixpanel SDKs: JavascriptIf you set this to 100%, all sessions would be recorded (up to your quota limit). If set to a lower percentage, only that proportion of sessions would be captured and count towards your quota.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
The session timeout of 30 minutes refers to the period of inactivity, not the total duration of a session. Let me clarify this based on the information from the knowledge sources: According to the Sessions: Compute sessions based on existing event data documentation: "The set session length is a period of activity at which a session is ended. The end time of the session is the time that the last event was performed before this period of inactivity."This means that the 30-minute default timeout is the maximum period of inactivity allowed before a session is considered to have ended. Here's how it works: 1. A session starts when a user performs an event. 2. Each time the user performs a new event, the 30-minute timer resets. 3. If the user doesn't perform any events for 30 minutes, the session ends. 4. The session end time is recorded as the time of the last event before the 30-minute inactivity period.The documentation provides an example to illustrate this: "For example, say you set a session timeout length of 15 minutes. A user begins a session when they log into your app and perform the event "Log In."- The "Log In" event marks the beginning of the session, because that user has not performed other events before. - The user then performs the "Start Game" event on your app after 14 minutes. This will restart the clock on the session timeout. - If they then perform no events for 16 minutes, however, the session will end. The session ends at the moment that the "Start Game" event was performed, because it was the last event before a complete session timeout period elapsed."It's important to note that there is a maximum session length, but it's not related to the timeout: "Sessions are reset every 24 hours at midnight (according to your project timezone), so the maximum session timeout length is 24 hours. The minimum session timeout length is one minute."This means that even if a user is continuously active, their session will be forcibly ended and a new one started at midnight each day.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
Yes, you've understood it correctly. Based on the information from the knowledge sources, here's how Mixpanel would handle the scenario you described: 1. Session Duration: If a user performs multiple events over a 2-hour period with less than 30 minutes of inactivity between events, all of these events would be considered part of a single session. This is because the default 30-minute inactivity timeout is never reached.2. Session Recording: Assuming this session is selected for recording (based on your sampling rate), all events within this 2-hour period would be captured in a single session replay.3. Quota Count: This entire 2-hour session, regardless of how many events it contains, would count as just 1 replay against your 20k monthly quota.Sessions: Compute sessions based on existing event data confirms this behavior: "A session starts when a user performs an event and ends when a user stops performing events for long enough that the set session length expires. The time of "Session End" is the time that the last event was performed by the timeout."It's important to note that while this 2-hour session counts as a single replay, there is a daily reset that could potentially split very long sessions: "Sessions are reset every 24 hours at midnight (according to your project timezone), so the maximum session length is 24 hours"So, as long as the 2-hour session doesn't cross the midnight boundary, it will be treated as a single session and count as 1 replay against your 20k quota, regardless of the number of events it contains.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
Let me check the knowledge base for you again. One moment! đź“š
Yes, you can adjust the session timeout in Mixpanel from the default 30 minutes to 1 hour or more. Here's how you can do it: According to the Sessions: Compute sessions based on existing event data documentation: "You can set the session timeout period in minutes, hours, or days. The default length is 30 minutes."To change the session timeout: 1. You need to be a Project Admin or Owner. 2. Go to your Project Settings. 3. Look for the Sessions configuration section. 4. Adjust the timeout value to your desired length.The documentation also mentions some important points to consider: 1. Maximum timeout: "Sessions are reset every 24 hours at midnight (according to your project timezone), so the maximum session timeout length is 24 hours."2. Minimum timeout: "The minimum session timeout length is one minute."3. Effect of changes: "Since Mixpanel computes sessions on the fly, you can change this definition at any time and it will apply historically."When deciding on the appropriate session length, Mixpanel suggests using the Time to Convert Chart in Funnels to help determine a suitable session timeout period that aligns with your users' behavior.Remember, changing the session timeout will affect how your session data is calculated and may impact your analytics. It's a good idea to consider your specific use case and user behavior patterns when adjusting this setting.Sessions: Compute sessions based on existing event data
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.