Expanding AnalyticsService API for Optimal PlayFab Integration

Hi, as a developer it is currently hard to gather meaningful data about user clicks/flow, game bottlenecks, and cohorts in my Roblox game. With PlayFab integration, Roblox offers only one method through which user-unattached event data is the only type of telemetry passed to the analytics tool. See AnalyticsService:FireEvent.

Since AnalyticsService only processes raw event telemetry, I am unable to link events triggered by specific users without passing user data into the value parameter of FireEvent method calls. See the following example with the current FireEvent method:

local AnalyticsService = game:GetService("AnalyticsService")
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(newPlayer)
    AnalyticsService:FireEvent("PlayerJoined", {
        Username = newPlayer.Name,
        UserId = newPlayer.UserId,
        AccountAge = newPlayer.AccountAge
    })
end)

It would make sense to expand the API for further connectivity with PlayFab. Other mobile and game telemetry APIs utilize identify or track methods which generate “users” inside of the analytics tool. Then events triggered by these users are recorded underneath a unique identifier and thus PlayFab features like querying, cohort analysis, session length, and funnels (or click flows) are more comprehendible and helpful. API like this might be helpful:

-- Server-side

local AnalyticsService = game:GetService("AnalyticsService")
local Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(newPlayer)
    AnalyticsService:Identify(tostring(newPlayer.UserID), {
        Username = newPlayer.Name,
        AccountAge = newPlayer.AccountAge
    })
end)
-- Client-side

local AnalyticsService = game:GetService("AnalyticsService")
local Players = game:GetService("Players")
local Player = Players.LocalPlayer
local BuyButton = Player.PlayerGui.ScreenGui.BuyButton

BuyButton.MouseButton1Click:Connect(function()
    AnalyticsService:FireEvent(tostring(Player.UserId), "Buy Item", {
          Price = 100,
          ItemName = "Apple"
     })
end)

In the example above, AnalyticsService would be client-compatible and calls to FireEvent would take a unique user identifier generated via a server-side Identify method as the first parameter. The call would also accept the custom event string category and value variant.

Making AnalyticsService more robust would mean that developers could gather better insights from PlayFab instead of having to be smart to generate workarounds. As developers, we want to be able to track what one user did from start-to-finish in-game to diagnose failures in user experience and to mitigate issues quickly.

As far as I am aware, PlayFab integration via AnalyticsService is going to be the forward direction for the platform as opposed to integration with Google Analytics (also documented on the developer hub) which has a similar API method to FireEvent called ReportEvent. We need stronger analytics tools and this post is hopefully being seen by a software engineer or a data team at Roblox HQ. Developers want enterprise-grade software capabilities for user telemetry. I know top games of Roblox like Adopt Me, Jailbreak, MeepCity, Phantom Forces, etc. would benefit dramatically. AnalyticsService needs to be able to track telemetry per user so that PlayFab can have a developer-facing API integration instead of us having to filter via value querying.

I know that AnalyticsService likely isn’t even fleshed out yet and that PlayFab isn’t completely available to everyone, but this post was just me getting my hopes up that the service evolves for the better.

:octopus:

4 Likes

This thread can be closed and also glad that Roblox has expanded AnalyticsService (AnalyticsService | Documentation - Roblox Creator Hub)

Thank you Roblox!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.