I am trying to get percentage of mobile users on a website using the Google Analytics API in PHP.
Per https://developers.google.com/analytics/devguides/reporting/core/v3/common-queries, I am pretty sure I am using the right dimensions/metrics (below):
dimensions=ga:mobileDeviceInfo,ga:source
metrics=ga:sessions,ga:pageviews,ga:sessionDuration
I get back an array of mobile devices (expected) but see no way to convert that into a percentage.
The first array element (not set) I assume is the non-mobile traffic, but the numbers simply don't add up ( non-mobile traffic / total number of sessions doesn't equal the % mobile in the Google Analytics dashboard).
Any ideas or examples.