0
votes

Is anybody knows how to get Visit Duration from Google Analytics report api v4?

I'm trying to find information in Dimensions & Metrics Explorer: https://developers.google.com/analytics/devguides/reporting/core/dimsmets But I don't see anything like that..

Updated:

I tried:

ga:sessionDuration - Total duration (in seconds) of users' sessions.

ga:avgSessionDuration - The average duration (in seconds) of users' sessions.

The result:

sessionDuration = "7.1339069E7",

avgSessionDuration = "322.4262946807236"

As far as I understand, it should be vice versa: sessionDuration is total, so it shoud be at least bigger than avgSessionDuration.. Also avgSessionDuration looks like what I need..

Thanks!

1
While I have never seen the API return scientific e notation I have to say that 7.1339069E7 (which is 7.1339069 multiplied by 10 to the power of 7) seems to be larger than 322 and a bit.Eike Pierstorff
Oh, exactly! thank you!Bo.

1 Answers

0
votes

Try using ga:sessionDuration which refers to total duration (in seconds) of user's sessions.

Also, you may want to regularly check Google Analytics Reporting API Changelog to be fully updated with the addition and renaming of dimensions and metrics that are already supported. Based from the changelog, ga:visitDuration was renamed to ga:timeOnSite then, was updated to ga:sessionDuration.

Hope that helps!