Thread:Extension talk:MobileFrontend/X-Analytics/mobile tracking?/reply

The X-Analytics header was introduced to unify some WMF-specific analytics-related data that we've been passing around in HTTP headers. You can read a little more about it on wikitech (https://wikitech.wikimedia.org/wiki/X-Analytics), but I dont know how much that info will help for your situation. For WMF purposes, this header can get set by Varnish, MobileFrontend, and/or ZeroRatedMobileAccess (for Wikipedia Zero). This was introduced in 1.21wmf11. You could conceivably use this header for your own purposes, although it would require some hacking. MobileFrontend/includes/MobileContext.php has some methods that would allow you to manipulate the contents of that header.

Are you trying to determine the numbers of users accessing your site on a mobile device, the number of users of the mobile version of your site, or the number of requests for mobile versions of your site? If you feel confident with PHP, it would be fairly straightforward to whip up a custom Mediawiki extension to either overload the X-Analytics header or return some other custom header when a request was made for the mobile version of your site. If you want to track number of unique users, that gets a little trickier but should be doable as well.