Analyzing Session Duration Across Devices, Users, and Regions with Preswald

Amrutha GujjarAmrutha Gujjar3 min read

Category: Use Case


📌 Business Use Case: What Problem Is Being Solved and Who It's For

In today’s digital-first economy, understanding how users interact with your product is critical to business success. One of the most essential user engagement metrics for any web or mobile product is session duration—how long users stay active during each visit. This metric provides a window into user satisfaction, product usability, and overall engagement.

For product managers, growth teams, and customer experience leaders, understanding session patterns across different user types, device platforms, and regions helps answer key questions:

  • Are premium users engaging longer than free users?

  • Does user behavior vary across devices?

  • Which regions are seeing drop-offs in engagement?

This Preswald-powered dashboard was built to solve this problem by providing real-time, no-code analysis of session duration trends. It’s aimed at product managers, UX designers, and data analysts who want quick, shareable insights without needing to write SQL or code dashboards from scratch.

📊 Data Walkthrough: Structure, Fields, and How It Might Be Collected

The dataset used for this dashboard comes from a typical session analytics table, which could be generated by any of the following platforms:

  • Mixpanel or Amplitude via export

  • Google Analytics with BigQuery integration

  • Segment piped into a data warehouse like Redshift or Snowflake

  • Internal analytics database (Postgres, MongoDB, etc.)

Each row in the drop_csv dataset represents a user session, and includes:

  • session_duration: Duration of the session in seconds or minutes

  • user_category: Type of user (e.g., Free, Premium, Trial)

  • device_type: Platform used for the session (e.g., Desktop, Mobile, Tablet)

  • region: Geographic location of the user (e.g., North America, Europe, Asia)

In a real-world company, this data is often auto-collected via client-side SDKs and then piped into an analytics tool. Cleaning involves standardizing categories and ensuring timestamped sessions are transformed into duration metrics.

This structured table gives us the foundation for powerful segment-based analysis.

🛠️ Building the Dashboard with Preswald

Built entirely in Preswald, this dashboard is deployed live here: Session Duration Dashboard

Here’s a walkthrough of what the app includes and how each component solves a business question:

🧩 Session Duration Breakdown by Device and User Category

The first visualization is a grouped bar chart that displays average session duration across different device_type values (e.g., mobile, desktop), broken down by user_category (e.g., Free, Premium).

Business Question Solved:

  • Are free users spending less time than premium users on mobile?

  • Is session time highest on desktop or mobile?

This helps product managers identify underperforming platforms and user tiers that may require UX fixes.

🌍 Session Duration by Region and User Category (Scatter Plot)

The next chart is a scatter plot that maps region on the x-axis and session_duration on the y-axis, colored by user_category.

Why It Matters:

  • Pinpointing which global regions are driving or losing engagement.

  • Layering this with user tiers shows if regional issues are affecting certain cohorts more.

UX teams might use this to localize features or A/B test onboarding flows in low-performing regions.

🔥 Heatmap of Session Duration by Region and Device

The third visualization is a density heatmap, which shows the intersection of region and device_type, with the intensity representing average session_duration.

Who Uses This:

  • Growth teams exploring where mobile performance is weakest.

  • QA or engineering teams using it to prioritize testing coverage by region/device combo.

This heatmap is especially powerful because it compresses a lot of data into one intuitive visual.

📋 Full Data Table

At the bottom of the app, there’s a full, scrollable table view of the dataset.

Why It Helps:

  • Enables raw inspection of specific sessions.

  • Great for QA and debugging unexpected outliers.

  • Makes the dashboard both executive-friendly and analyst-ready.


🎯 Why Preswald?

Building this dashboard in Preswald took just a few minutes—and zero frontend work. Key advantages:

  • Write pure Python, no JavaScript required

  • Add plots from Plotly, tables, sliders, and charts with one-liners

  • Share via link, no server management needed

  • Every input and filter auto-reactively updates the view

For teams used to juggling Jupyter notebooks, Tableau, or BI tools, Preswald offers the best of both worlds: the freedom of code and the polish of a dashboard.


🔗 Live Link and Final Thoughts

Explore the full dashboard here: https://preswald-project-9c7y2rky-ndjz2ws6la-ue.a.run.app/

This project showcases how session data—often locked in analytics platforms—can become instantly actionable when visualized right. From product strategy to international rollout planning, every chart provides a springboard for smarter decisions.

Whether you're a startup looking to boost stickiness or an enterprise optimizing product-market fit, this dashboard will help you get there faster.

Built with Preswald. Powered by Python. Designed for clarity.