Open BatDroid opened 1 year ago
Hi @BatDroid, did you take a look at the possible options from Matomo at https://developer.matomo.org/api-reference/tracking-api#optional-user-info?
Maybe it is something you can transmit with the ua
or uadata
params?
no, sorry, I'm new at Matomo, and I have millions of questions now.
thanks to your fast response & guide, I think I could reach into these, which seems to be part of the uadata
:
https://github.com/matomo-org/matomo-sdk-ios/blob/develop/MatomoTracker/Device.swift#L3
if you think I'm correct then feel free to close the ticket
I don't know exactly what you mean. How did you plan your next steps?
@donni106 I want to attach more info about the device to my request, so that I'll be able to have an overview of device types, OS, etc. What I don't know is that I don't know how the format of my body should be. as an example should be like:
{
uadata: {
device : {
type: "smartphone",
...
}
}
}
or something else ... still researching on this.
just to be more clear.
I don't see any statistics on how many users are using iPhone 12. how many are on what version of android and how many users are on smartphone
and how many on tablet
.
I made the uadata
like this but only the model
is being saved in dashboard, and it only get saved when I apply it like Json.stringify
. here is an example:
import * as Device from 'expo-device';
{
uid: userID,
uadata: JSON.stringify({
model: Device.deviceName,
brand: Device.brand
type: Device.DeviceType.Phone
})
}
I tried various combinations of data but here is all the data which I was able to let the Matomo detect. I wish I was able to make track more records. like the device type(table, smartphone), device brand (for android devices), etc
{
uid: userId,
res: `${Math.trunc(Dimensions.get('window').width)}x${Math.trunc(
Dimensions.get('window').height,
)}` as unknown as number,
uadata: JSON.stringify({
model: Device.deviceName,
platform: `${Device.osName}`,
platformVersion: `${Device.osVersion}`,
}) as unknown as object,
}
I understand your issue, thanks. I think this is something we need to ask Matomo directly. I do not know their system parameters. The way you send the informations with this library is totally correct. Now we need to know, which parameters uadata
can receive, right?
I found some example in the API reference at https://developer.matomo.org/api-reference/tracking-api#example-tracking-request
Here they transmit the os version as custom variable with _cvar
. Custom variables can be anything but maybe they also use some default ones for device brand and type.
I have created an issue at the Matomo GitHub asking for support on this.
So as they said:
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.
@donni106 thank you so much for following up. so do you have any idea what can be done for it?
What react native and expo versions is your app running? Do you have new insights with the latest versions? In my case, I can see more detailed information:
type | brand | model | screen |
---|---|---|---|
It seems that the point of logging is important. On app start, there are informations missing, but when tracking a screen, the details are present (at least on iOS, on Android it seems to be more often undefined):
app start | screen |
---|---|
Can you see some behavior like this in your case? As we need to rely on the underlying detection system ("device detector" as they said) and cannot pass information on our own, I cannot think of anything specific for us to do.
a few points:
uadata
feels very wrong for tracking mobile apps since Matomo's device detector works off of the UserAgentreact-native-matomo
handle this if at all?model
and screen
values you posted?
- @donni106 what params are you sending to get the
model
andscreen
values you posted?
this is what we do:
import Constants from 'expo-constants';
import * as Localization from 'expo-localization';
...
const ua = await Constants.getWebViewUserAgentAsync();
...
{
lang: Localization.locale,
res: `${device.width}x${device.height}`,
ua
}
...
Expo Constants: https://docs.expo.dev/versions/latest/sdk/constants
once we merge #23 I'd like to get started on #24 and incorporate
{
lang: Localization.locale,
res: `${device.width}x${device.height}`,
ua: await Constants.getWebViewUserAgentAsync(),
_id: Constants.sessionId,
}
@BatDroid @donni106 should we consider this issue as closed
?
@BatDroid @donni106 should we consider this issue as
closed
?
I still need to tackle the before mentioned PR and issue!
Is your feature request related to a problem? Please describe. I wanted to know if there can be a way to define the device type. there is a section in dashboard for it which everyone will be marked
unknown
eventually. it could be good if we could implement it with expo-device package and at least know whether the users are with phone or tablets