AnalyticsService
Not Creatable
Service
Not Replicated

Summary

Properties
ApiKey:string
Deprecated
Methods
FireCustomEvent(player: Instance,eventCategory: string,customData: Variant):()
Deprecated
FireEvent(category: string,value: Variant):()
Deprecated
FireInGameEconomyEvent(player: Instance,itemName: string,economyAction: Enum.AnalyticsEconomyAction,itemCategory: string,amount: number,currency: string,location: Variant,customData: Variant):()
Deprecated
FireLogEvent(player: Instance,logLevel: Enum.AnalyticsLogLevel,message: string,debugInfo: Variant,customData: Variant):()
Deprecated
FirePlayerProgressionEvent(player: Instance,category: string,progressionStatus: Enum.AnalyticsProgressionStatus,location: Variant,statistics: Variant,customData: Variant):()
Deprecated
LogCustomEvent(player: Player,eventName: string,value: number,customFields: Dictionary):()
LogEconomyEvent(player: Player,flowType: Enum.AnalyticsEconomyFlowType,currencyType: string,amount: number,endingBalance: number,transactionType: string,itemSku: string,customFields: Dictionary):()
LogFunnelStepEvent(player: Player,funnelName: string,funnelSessionId: string,step: number,stepName: string,customFields: Dictionary):()
LogJourneyEvent(player: Player,journeyName: string,nodeName: string,journeySessionId: string,customFields: Dictionary):()
LogOnboardingFunnelStepEvent(player: Player,step: number,stepName: string,customFields: Dictionary):()
LogProgressionCompleteEvent(player: Player,progressionPathName: string,level: number,levelName: string,customFields: Dictionary):()
LogProgressionEvent(player: Player,progressionPathName: string,status: Enum.AnalyticsProgressionType,level: number,levelName: string,customFields: Dictionary):()
LogProgressionFailEvent(player: Player,progressionPathName: string,level: number,levelName: string,customFields: Dictionary):()
LogProgressionStartEvent(player: Player,progressionPathName: string,level: number,levelName: string,customFields: Dictionary):()
Inherited Members

API Reference
Properties
ApiKey
Deprecated

Methods
FireCustomEvent
Deprecated

FireEvent
Deprecated

FireInGameEconomyEvent
Deprecated

FireLogEvent
Deprecated

FirePlayerProgressionEvent
Deprecated

GetPlayerSegmentsAsync
Yields
Capabilities: Basic
AnalyticsService:GetPlayerSegmentsAsync(player:Player):Dictionary
Parameters
player:Player
Returns
Code Samples
Configure server-side experiences with player segments
local Players = game:GetService("Players")
local AnalyticsService = game:GetService("AnalyticsService")
local function configurePlayerExperience(player)
local segments = AnalyticsService:GetPlayerSegmentsAsync(player)
if not segments.HasData then
return
end
if segments.WhenUserFirstPlayed == Enum.WhenUserFirstPlayed.Days0To30 then
print("Show additional onboarding for", player.Name)
end
if segments.ActivePayerStatus == Enum.ActivePayerStatus.Top15Percent then
print("Show high-value offer to", player.Name)
end
end
Players.PlayerAdded:Connect(configurePlayerExperience)

LogCustomEvent
Capabilities: Basic
AnalyticsService:LogCustomEvent(
player:Player, eventName:string, value:number, customFields:Dictionary
):()
Parameters
player:Player
eventName:string
value:number
Default Value: 1
customFields:Dictionary
Default Value: nil
Returns
()
Code Samples
Log Custom Event
local AnalyticsService = game:GetService("AnalyticsService")
local Players = game:GetService("Players")
local missionBoard = script.Parent
local missionStartTimes: { [Player]: number } = {}
local prompt = Instance.new("ProximityPrompt")
prompt.ActionText = "Mission"
prompt.Parent = missionBoard
prompt.Triggered:Connect(function(player)
local startTime = missionStartTimes[player]
if startTime == nil then
-- The player accepts the mission
missionStartTimes[player] = os.clock()
AnalyticsService:LogCustomEvent(
player,
"MissionStarted" -- Custom event name
)
else
-- The player turns the mission in
missionStartTimes[player] = nil
AnalyticsService:LogCustomEvent(
player,
"MissionCompletedDuration", -- Custom event name
os.clock() - startTime -- Event value used in aggregation: seconds the mission took
)
end
end)
Players.PlayerRemoving:Connect(function(player)
missionStartTimes[player] = nil
end)

LogEconomyEvent
Capabilities: Basic
AnalyticsService:LogEconomyEvent(
player:Player, flowType:Enum.AnalyticsEconomyFlowType, currencyType:string, amount:number, endingBalance:number, transactionType:string, itemSku:string, customFields:Dictionary
):()
Parameters
player:Player
currencyType:string
amount:number
endingBalance:number
transactionType:string
itemSku:string
customFields:Dictionary
Default Value: nil
Returns
()
Code Samples
Tracking an in-app purchase
local AnalyticsService = game:GetService("AnalyticsService")
local MarketplaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")
local COIN_BUNDLE_PRODUCT_ID = 123456 -- Replace with the ID of your developer product
local COINS_IN_BUNDLE = 1000
-- Stand-in for your own data storage: how many coins each player has
local coinBalances: { [Player]: number } = {}
MarketplaceService.ProcessReceipt = function(receiptInfo)
local player = Players:GetPlayerByUserId(receiptInfo.PlayerId)
if not player then
return Enum.ProductPurchaseDecision.NotProcessedYet
end
if receiptInfo.ProductId == COIN_BUNDLE_PRODUCT_ID then
local balance = (coinBalances[player] or 0) + COINS_IN_BUNDLE
coinBalances[player] = balance
AnalyticsService:LogEconomyEvent(
player,
Enum.AnalyticsEconomyFlowType.Source,
"Coins",
COINS_IN_BUNDLE, -- How many coins are in the bundle
balance, -- balance after transaction
Enum.AnalyticsEconomyTransactionType.IAP.Name,
"1000CoinBundle" -- Unique identifier of the coin bundle
)
end
return Enum.ProductPurchaseDecision.PurchaseGranted
end

LogFunnelStepEvent
Capabilities: Basic
AnalyticsService:LogFunnelStepEvent(
player:Player, funnelName:string, funnelSessionId:string, step:number, stepName:string, customFields:Dictionary
):()
Parameters
player:Player
funnelName:string
funnelSessionId:string
step:number
Default Value: 1
stepName:string
customFields:Dictionary
Default Value: nil
Returns
()
Code Samples
Tracking Shop steps
local AnalyticsService = game:GetService("AnalyticsService")
local HttpService = game:GetService("HttpService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local FUNNEL_NAME = "ArmoryCheckout" -- Funnel name used to group steps together
-- Step number and name for each action the client can report
local STEPS = {
OpenStore = { number = 1, name = "Opened Store" },
ViewItem = { number = 2, name = "Viewed Item" },
AddToCart = { number = 3, name = "Added to Cart" },
}
-- The client fires this with "OpenStore", "ViewItem" or "AddToCart" as the shop UI is used
local shopActionEvent = Instance.new("RemoteEvent")
shopActionEvent.Name = "ShopAction"
shopActionEvent.Parent = ReplicatedStorage
local funnelSessionIds: { [Player]: string } = {}
shopActionEvent.OnServerEvent:Connect(function(player, action)
local step = STEPS[action]
if step == nil then
return
end
if action == "OpenStore" then
-- Every time the shop opens starts a new checkout session
funnelSessionIds[player] = HttpService:GenerateGUID()
end
local funnelSessionId = funnelSessionIds[player]
if funnelSessionId == nil then
return
end
AnalyticsService:LogFunnelStepEvent(
player,
FUNNEL_NAME,
funnelSessionId, -- Funnel session ID for this unique checkout session
step.number, -- Step number
step.name -- Step name
)
end)
Players.PlayerRemoving:Connect(function(player)
funnelSessionIds[player] = nil
end)

LogJourneyEvent
Capabilities: Basic
AnalyticsService:LogJourneyEvent(
player:Player, journeyName:string, nodeName:string, journeySessionId:string, customFields:Dictionary
):()
Parameters
player:Player
journeyName:string
nodeName:string
journeySessionId:string
customFields:Dictionary
Default Value: nil
Returns
()

LogOnboardingFunnelStepEvent
Capabilities: Basic
AnalyticsService:LogOnboardingFunnelStepEvent(
player:Player, step:number, stepName:string, customFields:Dictionary
):()
Parameters
player:Player
step:number
stepName:string
customFields:Dictionary
Default Value: nil
Returns
()
Code Samples
Tracking onboarding steps
local AnalyticsService = game:GetService("AnalyticsService")
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
-- The client fires this once the player picks a class in the onboarding UI
local chooseClassEvent = Instance.new("RemoteEvent")
chooseClassEvent.Name = "ChooseClass"
chooseClassEvent.Parent = ReplicatedStorage
Players.PlayerAdded:Connect(function(player)
-- Log the first step of the FTUE
AnalyticsService:LogOnboardingFunnelStepEvent(
player,
1, -- Step number
"Joined Game" -- Step name
)
end)
chooseClassEvent.OnServerEvent:Connect(function(player)
-- Log the second step of the FTUE
AnalyticsService:LogOnboardingFunnelStepEvent(
player,
2, -- Step number
"Choose Class" -- Step name
)
end)

LogProgressionCompleteEvent
Capabilities: Basic
AnalyticsService:LogProgressionCompleteEvent(
player:Player, progressionPathName:string, level:number, levelName:string, customFields:Dictionary
):()
Parameters
player:Player
progressionPathName:string
level:number
levelName:string
customFields:Dictionary
Default Value: nil
Returns
()

LogProgressionEvent
Capabilities: Basic
AnalyticsService:LogProgressionEvent(
player:Player, progressionPathName:string, status:Enum.AnalyticsProgressionType, level:number, levelName:string, customFields:Dictionary
):()
Parameters
player:Player
progressionPathName:string
level:number
levelName:string
customFields:Dictionary
Default Value: nil
Returns
()

LogProgressionFailEvent
Capabilities: Basic
AnalyticsService:LogProgressionFailEvent(
player:Player, progressionPathName:string, level:number, levelName:string, customFields:Dictionary
):()
Parameters
player:Player
progressionPathName:string
level:number
levelName:string
customFields:Dictionary
Default Value: nil
Returns
()

LogProgressionStartEvent
Capabilities: Basic
AnalyticsService:LogProgressionStartEvent(
player:Player, progressionPathName:string, level:number, levelName:string, customFields:Dictionary
):()
Parameters
player:Player
progressionPathName:string
level:number
levelName:string
customFields:Dictionary
Default Value: nil
Returns
()

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.