I’ve been running some analyses on our atomic.events
table and noticed that dvce_type
is always 'Computer'
for events sent from mobile trackers. The field dvce_ismobile
is also set to FALSE
for all mobile tracker events despite it clearly being true. Is this expected behavior?
Hi @travisdevitt,
The device fields in atomic.events
are set based on the value in useragent
(this happens during enrichment). The mobile trackers don’t set the useragent, unless it’s added to the subject using setUseragent
:
- https://github.com/snowplow/snowplow/wiki/Android-Tracker#318-setuseragent
- https://github.com/snowplow/snowplow/wiki/iOS-Tracker#39-set-the-useragent-with-setuseragent
This can be useful in couple of cases (if the app has a built-in browser, or if it uses webviews).
We use 2 libraries to parse the useragent string:
- https://github.com/snowplow/snowplow/wiki/user-agent-utils-enrichment
- https://github.com/snowplow/snowplow/wiki/ua-parser-enrichment
If useragent
is set using setUseragent
, it can take any value. It is therefore not guaranteed that it will be recognised by the libraries (which were written with browsers in mind). This is most likely what is happening in this case.
In general, I wouldn’t use the device field in atomic.events
to analyse events from the iOS and Android trackers. Instead, I recommend you use the mobile context to get the device-related fields.
Hope this helps!
Christophe
Ok thanks…is the same true for the ua_parser_context (should we only rely on mobile context to get device related info for events sent from mobile trackers)?
That’s correct. The mobile context and the client session context are the 2 most important tables when analysing events from the iOS and Android trackers.
We plan to restructure atomic.events
to move all these web-specific fields into their own event and context tables. The reason they are still in the main table is because Snowplow initially only tracked events from the web (back in 2012).
That all makes sense, thanks!
A quick note to say that I updated my first post with more details on why the useragent is set in the first place.