How do I manually calculate average session duration?

Hallo guys, can anyone help me tell the exact formula of the average session duration where to get from? I’m having trouble finding a manual calculation of the average session duration

For example, from the google analytics report, I got an average session duration of 20 seconds. How is the manual calculation?

I’ve tried to calculate with this formula “Avg Session Duration = Session Duration / Sessions” but didn’t find the same result

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there @rifulabyssal,

To calculate the average session duration you need to divide the total duration fo all sessions on your website in seconds by the total number of sessions.

Let’s say that in 1 day you had 5 website visitors:

  1. Visit: 100 seconds on your site
  2. Visit: 50 seconds on your site
  3. Visit: 120 seconds on your site
  4. Visit: 20 seconds on your site
  5. Visit: 5 seconds on your site

So what you need to do is add them all together: For example, say in one week you had three website visitors:

100 + 50 + 120 + 20 + 5 = 295 seconds

Then divide that number by 5 as there were 5 sessions:

295 / 5 = 59

So the average session duration for that day on your site was 59 seconds.

Hope that this helps! Regards, Bobby