Firebase User Engagement Calculation - google-bigquery

I am trying to wrap my head around the Firebase User Engagement Calculation. I am doing a lot of debugview testing now, and as the online documentation states (https://support.google.com/firebase/answer/6317485), Firebase is firing the user_engagement event by default on a periodic basis within a session while the app is in the foreground.
What I have seen thusfar is that user_engagement is fired quite reliably in the beginning and end of an engagement (this can be occurring multiple times in a specific session).
Scenario:
Say for instance I started my session and exited the app, but returned again within the the same 30 minutes time slot. The session_start won't fire again, but only user_engagement. This is quite clever, because I can actually then query first and last engagement experienced within this scenario.
My question is:
How would I actually then query the difference between the beginning of a user_engagement and end of the user engagement ? Currently engagement_time_msec allows me to measure: The additional engagement time (ms) since the last user_engagement event (https://support.google.com/firebase/answer/7061705?hl=en), and not since the beginning of the user_engagement. What if I wanted to measure engagement from the first engagement and last engagement, assuming my specific scenario describe earlier. The idea of this question is to ask how would an example query look like to address this question.

Since I posted this question, I found it would be a lot wiser to look at Session Duration and not Duration between User Engagement Events.
As far as I know, one can not update settings of the user_engagement event, but one can however determine when a session should start (after 0, 5, 10, 15, etc seconds) and b) when a session should end (after 10, 30, 60, etc minutes of inactivity).
To help you get started here is great examples:
How to calculate Session and Session duration in Firebase Analytics raw data?
Session Calculations
Session-Duration Distribution-table in Firebase
Sessions-per-User Distribution-table in Firebase
Important: a Firebase session starts by default after at least 10s since a user_engagement event was triggered (and a session ends after a period of at least 30 minutes of no triggers of user_engagement). And so, whenever users use your app for a period of less than 10s, you will accrue user engagement without a session. This typically means that you will have higher active user base in your dashboard, than users which started a session under your Firebase Events'-tab.

Related

How do we track time of guacamole rdp session?

Actually, I have a scenario where I want my user to be able to use my guacamole service to connect the RDP for 5 hours free. After that, I wanted to charge so I wanted to track down the usage time of the user. Is there any official parameter to set or some API that can help?
I first time using guacamole so have no idea about it. I found a property called api-session-timeout but turns out that it was used to disconnect users after a certain time of inactivity. Whereas in my case I wanted the user to not cross 5 hours. The sessions can also be broken into minutes or hours. I just want to get data on login and logout so I can count 5 hours of usage.

How to calculate Session Duration or Call Duration for a session ID in TokBox API?

How to calculate Session Duration or Call Duration in TokBox API?
We need to display Session/Call duration for each Session-Id, we created from Backend. In our case, only 2 people can connect to a session as we are sharing session-id & token with two users only. Now On the Admin Panel, we need the Actual Call time between these two users.
Is there any API which provides these statics?
There is no such API to calculate the exact call duration.
You can check your invoices on the dashboard under the billing section.
Another way is, you can log the timestamps on event listeners. Like when the first-person joins the session, connectionCreated event gets fired, in that you can log your time stamp and send it to your server. Similarly, when someone leaves the session, you get connectionDestroyed event. Refer to this page for all events related to the session.
You can also refer to our Session Monitoring API - https://tokbox.com/developer/guides/session-monitoring/ which lets you receive real-time session callback events on your server endpoint thereby monitoring the user's session activity.
By using the events mentioned above you can calculate the session duration.
Thanks!

Discrepancy in active usage Fabric vs Firebase

For an Android application, I am tracking active usage on both Fabric and Firebase. Since the most recent release I am noticing significant discrepancies between the number of daily active users.
From the Fabric docs I understand that active usage is defined as:
The number of unique app installations across all devices that were
active on a specific day. Note: Foreground activity must happen for a
device to be active.
Firebase groups active users based on user engagement with a minimal session duration of X seconds (typically 10 secs):
An active user has engaged with an app in the device foreground, and
has logged a user_engagement event.
A possible reason for the discrepancy could be that firebase triggers a first_open event when an app is updated which would mean that users are added that have only updated but not engaged with the app.
However, looking at user_engagement and first_open in bigquery
I can see that they provide different estimates (user_engagement exceeding first_open events). In this case filtering on user_engagement is equal to the number of active users in the firebase dashboard.
Did anybody experience similar discrepancies? I have had contact with both Firebase and Fabric but this did not resolve my issue. Importantly, it is not within a small margin of error, Firebase active users are 4-5 times bigger compared to Fabric.

Calculate Daily Active Users with Devise

Iam a RoR developer and I want to calculate DAU for my website. By DAU I mean:
DAU- Total Number of users who either came to my website and logged in or who came to the website and were already logged in.
I implemented Devise in my website because it tracks current_sign_in_at. And later found that these attributes mean as:
current_sign_in_at - The latest time the person logged in to my website.
(Using this I can get the count of people who came to my website and logged in.)
But I am missing the count of people who came to the website and were already logged in.
One of the way I found to implement it is trigger a function in delayed job which updates the timestamp whenever the root action is called and home page of my website loads. But since my website gets around 1000 - 2000 hits per minute I guess this function will become the bottleneck.
Can anyone please suggest me the best way to implement it.
Many Thanks.
Possible solutions:
Use a service like Google Analytics(custom variables), KISSmetrics(visitor identity) or Mixpanel(distinct_id) and send them the user id and you can find daily active users.
You can do something like what you mentioned, store the last active time for the user in a database each time you get a request, if you get 1000-2000 hits per minute, you might want to store it in an in memory store like redis instead. If users will be coming to your website from different paths and not just root url you could create a after_filter in the application controller which updates the redis store with the current time for the user.
If you are interesting in looking at more then just the daily active users in future, it is worthwhile to create a log for your users in another database. Again I'd suggest an before or after_filter in application_controller which queues a job to store time, user_id, any other data you might be interested in. I'm using a mongo db separate from my ActiveRecord MySQL database to do this.

Fetching data via Facebook connect taking over 10 seconds

Our site uses Facebook connect. When a new user signs up we ask for permission to pull their interest data, their list of friends, and their friends' interests. Fetching this data used to be a very quick process (couple seconds). Over the last week or so, the time to fetch this data has increase to 10+ seconds. According to Facebook insights, our site is not being throttled. We didn't make any changes to our site.
Anyone else experiencing this issue with Facebook? Have any ideas for how to address it?
Thanks!
As of 1/26 at 7:55 PM EST, the live status page doesn't indicate any irregular activity.
Sometimes this occurs because a user simply has a lot of likes and interests. I would recommend making this operation asynchronous following a flow something like this:
User connects with your app
Get the access token and store it in a queue that a background process can access.
Get all the information you need immediately to make the app work.
Some time later
In a background process, grab an access token from the queue, parse it and handle it however you'd like.
A simpler, although less stable option, is redirecting the user to a page upon installation which makes an AJAX request to that page telling it to download the information from the graph. This keeps the response time low, but does require your user to have Javascript enabled and for them to stay on the destination page long enough for the request to be created.