Open donni106 opened 1 year ago
Hi @donni106. Thanks for creating the issue. Guess we could improve the documentation around that. The javascript tracker code to gather the data is located here: https://github.com/matomo-org/matomo/blob/2c63f2726077b57275ee0d74a1f0c9ac2a147529/js/piwik.js#L3070-L3088 The values send with uadata then are checked with device detector. So it's not possible to send through random values, as they might get ignored then.
@sgiehl are you saying that when using Matomo to track mobile apps, there is no way to override device model? How does the matomo-sdk-ios
handle this then? Is the solution sending a custom user-agent that is structured in a way that Matomo's device detector
can consume?
Yes a custom value is not possible at the moment. Haven't looked at the sdks lately, but I think they were sending though custom useragents that allowed detecting the device.
Awesome. Thank you for the clarification. For a bit of context: we are using the http api with ReactNative but are unable to use the IOS SDK due to compatibility. We can gather information about the user device but do not know how to populate it on Matomo.
Seems to me like the solution is to use a user agent value that best matches the device info. Where could we learn more about
Where could we learn more about how Matomo breaks down the user agent and infers device info?
Matomo uses https://github.com/matomo-org/device-detector/ to detect device / model / client / os. It contains a big list of regular expression to look for certain fragments. The iOS SDK uses this to create the useragent: https://github.com/matomo-org/matomo-sdk-ios/blob/32c2353d5b57f9e144f199a544c7fe1df9561236/MatomoTracker/UserAgent.swift#L17-L22, maybe you can create something similar.
This is gold. Thank you so very much. @donni106 guess we have our answers.
In order to transmit several specific values from mobile devices like brand, os, type, ... it seems to be legit to use
uadata
. There is an issue started at https://github.com/donni106/matomo-tracker-react-native/issues/13 about that topic, where values are undefined and presented as unknown in Matomo.Is there a way to enrich the data per
uadata
or what are the correct params to use?https://developer.matomo.org/api-reference/tracking-api#optional-user-info