I tried to retrieve web sessions for my web application to determine the network type (such as 3G or 4G) that users are using, but no sessions are being returned. Could you assist me in resolving this issue?
Here is the query I used:
SELECT * FROM usersession
WHERE useraction.application = “my_web_app” AND usersession.networkTechnology IN (“3G”, “2G”, “4G”, “5G”, “802.11x”, “CTRadioAccessTechnologyHSDPA”, “CTRadioAccessTechnologyLTE”)
This query works for mobile apps, and sessions are successfully retrieved. However, when querying for web app sessions, no data is returned. Could you please help me understand why the query works for mobile apps but not for web sessions?
As per my knowledge it is not captured by web application, if you run below query, the connection type is “UNKNOWN” mostly.
Probably because of different browsers.
select connectionType FROM usersession WHERE applicationType=“WEB_APPLICATION”
The mobile app session data attempts to obtain the details from device. It stores these within the user session table, which is why it can be queried.
Conversely, web applications has this data collected on a best effort basis from the browser network APIs (as Rohit pointed out). It means not all modern browsers support this, so it will often be missing. Furthermore, the browsers only support showing 2g, 3g, 4g up to 10Mbit/s from what I’ve seen. It’s not much use at showing ‘modern’ downlink speeds (i.e. 200Mbit/s will still show as 4g, 10Mbit/s)
This is also not stored in the user session / actions table. Rather, it’s stored in the waterfall analysis view of a user action and so it’s only kept in short term retention for up to 10 days. It means it cannot be queried directly with USQL.
You will see this on the UA view:
Effective connection type: 4gNetwork downlink: 10 Mbit/sTo be able to query it from USQL, it needs to be converted to user session / action properties first. This might be possible by referencing a JS variable.
Note, you can confirm which browsers support this as follows.In DevTools, on the console, this works on Edge:
I followed the steps outlined in the documentation and used the JavaScript variable navigator.connection.connectionType as suggested. However, when I run the query in any web app, I am not getting any values returned.