matomo-org / matomo-sdk-ios

Matomo iOS, tvOS and macOS SDK: a Matomo tracker written in Swift
MIT License
388 stars 164 forks source link

more detailed tracking of device #226

Closed Yetispapa closed 6 years ago

Yetispapa commented 6 years ago

we implemented the matomo iOS sdk in our mobile app for analytics. Everything works greate. We just noticed that in our dashboard we only get "Apple - IPhone" as the device tracked. Now with a deeper look into the code of the matomo SDK I could find source code which reads out all the detailed stuff which we want like this:

 static func makeCurrentDevice() ->  Device {
        let platform = currentPlatform()
        let humanReadablePlatformName = humanReadablePlatformNameForCurrentDevice()
        let os = osVersionForCurrentDevice()
        let screenSize = screenSizeForCurrentDevice()
        let nativeScreenSize = nativeScreenSizeForCurrentDevice()
        return Device(platform: platform,
                      humanReadablePlatformName: humanReadablePlatformName,
                      osVersion: os,
                      screenSize: screenSize,
                      nativeScreenSize: nativeScreenSize)
    }

but the only information which is taken is screenSize:

public struct Event {
..
let screenResolution : CGSize = Device.makeCurrentDevice().screenSize

Is there a way to retrieve the detailed device model? So that we can see it in our dashboards.

Thanks in advance

brototyp commented 6 years ago

Hi @Yetispapa, thanks for your question. Since that is a frequently asked question, I just added an FAQ page to the wiki answering your question. Please try that out.