I was looking at the Games Dashboard feature added recently to GDevelop and I was thinking about using it in one of my games, since I would like to get a better understanding about the game and the users. Unfortunately, the Wiki doesn’t provide enough details about how the stats are collected and how often, how the users are identified and how can access that data without going through the GDevelop app.
Anyone has any details to share?
From what I remember, the stats are sent once about 10 seconds after opening the game (the delay is there to let you call the action to disable it), i’d need to check though
Ok after checking the code here is what I’ve found:
This is the data initially sent when initializing analytics:
Once the analytics are initialized, they cannot be deinitialized without restarting the game. The analytics are started automatically after playing for 10 seconds and whenever you call the action to toggle analytics on and off with the option on. The option off will stop the 10 seconds countdown. That means that if you want the analytics to be opt-in for the users, you will have to disable at the beginning of the game all analytics and enable them after they opted in. If they later chose to opt out, you will need to make them restart the game to actually disable the analytics.
The session events are sent everytime specific browser events are called: the events “beforeunload”, “pagehide” and “visibilitychange” will trigger a session hit. The session hit has only a player id, the game id and a session id. A session hit can only be sent every 3 seconds max. The player ID is stored in persistent storage and is generated via UUIDv4. The session id comes from the server after sending the initial data. That is all information I could find.
Midhil I obviously missed that page on the wiki, thank you.
That’s great detail there arthuro555 about the internal functionality of the metrics collection. If I understand correctly, metrics are being sent to the server continuously, after specific events, while the game is playing. Not sure if I want to use them anymore.
Thanks again for the help both of you!
No, no, you got me all wrong. They are sent once and only once exactly 10 seconds after starting the game if you haven’t disabled analytics, or the first time you enable analytics.
Whatever happens, the metrics themselves are sent always a single time.
What is sent later is the session hit, which marks the end of a session. This is called on those browser events:
As you can read, those events happen when you leave the game window. That is how GDevelop analytics knows the session count: after the player left, the next time he opens up the window it is to start a new session. Multiple events are used to assure cross browser compatibility, as some don’t completely work. The session hit only says that this user has stopped playing, it doesn’t send all metrics again.
Do you mean that if the player turns off analytics in the middle of the game, then he will have to restart the game to apply the change? Is it also the same for turning on analytics?
I see what you mean arthuro, I was indeed confused. This is a much preferred way to have metrics on the game.
What I meant is once the analytics are on, they will still signal the end of the session to the server even if they are turned off in the meantime.