Lesson 2
Track your own events
Goal: Send funnel and economy events from the server.
about 6 min3 practice exercises
Roblox's built-in charts cannot know what matters inside your game. You tell it, with events sent from a server script.
Funnel events show where new players drop out of a sequence, such as your onboarding:
local AnalyticsService = game:GetService("AnalyticsService")
AnalyticsService:LogOnboardingFunnelStepEvent(player, 1, "Joined")
AnalyticsService:LogOnboardingFunnelStepEvent(player, 2, "First coin collected")
Economy events show where currency comes from (a source) and where it goes (a sink):
AnalyticsService:LogEconomyEvent(
player,
Enum.AnalyticsEconomyFlowType.Sink,
"Coins",
50, -- amount, always positive
player.leaderstats.Coins.Value, -- balance after the purchase
Enum.AnalyticsEconomyTransactionType.Shop.Name,
"SpeedBoots" -- your item identifier
)
The order is: player, flow type, currency name, amount, balance after, transaction type, and an optional item identifier.
Rules that apply to both:
- Events are sent from the server only, and only in published games. Nothing arrives from a Studio play test.
- A funnel counts the first time a player reaches each step.
If sources are far larger than sinks, players pile up currency and stop caring about it. If sinks are larger, they cannot afford anything. The economy charts make either one visible.
Sources
Checked against Roblox's documentation on . The lesson is in our own words; these pages are the source of truth.