Trying to get percentage of mobile users using Google Analytics API (PHP) -
i trying percentage of mobile users on website using google analytics api in php.
per https://developers.google.com/analytics/devguides/reporting/core/v3/common-queries, pretty sure using right dimensions/metrics (below):
dimensions=ga:mobiledeviceinfo,ga:source metrics=ga:sessions,ga:pageviews,ga:sessionduration i array of mobile devices (expected) see no way convert percentage.
the first array element (not set) assume non-mobile traffic, numbers don't add ( non-mobile traffic / total number of sessions doesn't equal % mobile in google analytics dashboard).
any ideas or examples.
instead of using ga:mobiledeviceinfo, use ga:devicecategory. way you're able see number of sessions desktop, tablet, mobile. match see in interface?
dimensions=ga:devicecategory metrics=ga:sessions also bear in mind make sure date range/filters/segmentation of api , ui same.
Comments
Post a Comment