AnalyticsService
Collection of methods that allows developers to track how users interact with their experiences.
Memory category | Instances |
---|
Member index 14
Removed member index 13
Description
AnalyticsService is a collection of methods that allows developers to track how users interact with their experiences, specifically player progression, in-experience economy, funnels, and custom events.
History 63
- 637 Add LogCustomEvent
- 632 Change Parameters of LogFunnelStepEvent from (player: Player, funnelName: string, funnelSessionId: string = , step: int = 0, stepName: string = , customFields: Dictionary = nil) to (player: Player, funnelName: string, funnelSessionId: string = , step: int = 1, stepName: string = , customFields: Dictionary = nil)
- 623 Change Parameters of LogEconomyEvent from (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, endingBalance: float, amount: float, transactionType: string, itemSku: string = , customFields: Dictionary = nil) to (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, amount: float, endingBalance: float, transactionType: string, itemSku: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogProgressionStartEvent from (player: Player, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, level: int, levelName: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogProgressionFailEvent from (player: Player, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, level: int, levelName: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogProgressionEvent from (player: Player, status: AnalyticsProgressionType, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, status: AnalyticsProgressionType, level: int, levelName: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogProgressionCompleteEvent from (player: Player, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, level: int, levelName: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogOnboardingFunnelStepEvent from (player: Player, step: int, customFields: Array) to (player: Player, step: int, stepName: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogFunnelStepEvent from (player: Player, funnelName: string, step: int, customFields: Array) to (player: Player, funnelName: string, funnelSessionId: string = , step: int = 0, stepName: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogEconomyEvent from (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, endingBalance: float, amount: float, transactionType: string, itemSku: string, customFields: Array) to (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, endingBalance: float, amount: float, transactionType: string, itemSku: string = , customFields: Dictionary = nil)
- 619 Add LogProgressionStartEvent
- 619 Add LogProgressionFailEvent
- 619 Add LogProgressionEvent
- 619 Add LogProgressionCompleteEvent
- 619 Add LogOnboardingFunnelStepEvent
- 619 Add LogFunnelStepEvent
- 619 Add LogEconomyEvent
- 619 Change Tags of FirePlayerProgressionEvent from [] to [Deprecated]
- 619 Change Tags of FireLogEvent from [] to [Deprecated]
- 619 Change Tags of FireInGameEconomyEvent from [] to [Deprecated]
- 619 Change Tags of FireCustomEvent from [] to [Deprecated]
- 619 Change Tags of AnalyticsService from [Service, Deprecated] to [NotCreatable, Service, NotReplicated]
- 573 Change ReturnType of FirePlayerProgressionEvent from void to null
- 573 Change ReturnType of FireLogEvent from void to null
- 573 Change ReturnType of FireInGameEconomyEvent from void to null
- 573 Change ReturnType of FireEvent from void to null
- 573 Change ReturnType of FireCustomEvent from void to null
- 549 Change Tags of AnalyticsService from [Service] to [Service, Deprecated]
- 486 Change ThreadSafety of ApiKey from ReadOnly to ReadSafe
- 462 Change ThreadSafety of FirePlayerProgressionEvent from to Unsafe
- 462 Change ThreadSafety of FireLogEvent from to Unsafe
- 462 Change ThreadSafety of FireInGameEconomyEvent from to Unsafe
- 462 Change ThreadSafety of FireEvent from to Unsafe
- 462 Change ThreadSafety of FireCustomEvent from to Unsafe
- 462 Change ThreadSafety of ApiKey from to ReadOnly
- 457 Add FirePlayerProgressionEvent
- 457 Add FireLogEvent
- 457 Add FireInGameEconomyEvent
- 457 Add FireCustomEvent
- 457 Change Tags of AnalyticsService from [NotCreatable, Service] to [Service]
- 438 Change Tags of FireEvent from [] to [Deprecated]
- 438 Change Tags of ApiKey from [] to [Deprecated]
- 397 Change Tags of AnalyticsService from [NotCreatable, Service, NotReplicated] to [NotCreatable, Service]
- 391 Add FireEvent
- 391 Add ApiKey
- 391 Add AnalyticsService
- 386 Remove AnalyticsService
- 377 Add TrackEventWithArgs
- 364 Add GetSessionId
- 364 Add GetClientId
- 348 Add SendEventImmediately
- 348 Add SendEventDeferred
- 335 Add ReleaseRBXEventStream
- 325 Change Parameters of TrackEvent from (category: string, action: string, label: string) to (category: string, action: string, label: string, value: int64 = 0)
- 310 Add ReportInfluxSeries
- 291 Add TrackEvent
- 276 Add SetRBXEventStream
- 270 Add UpdateHeartbeatObject
- 269 Change Parameters of SetRBXEvent from (eventContext: string, eventName: string, additionalArgs: Dictionary) to (target: string, eventContext: string, eventName: string, additionalArgs: Dictionary)
- 269 Add ReportStats
- 269 Add ReportCounter
- 268 Add SetRBXEvent
- 268 Add AnalyticsService
Members 14
ApiKey
Type | Default | |
---|---|---|
string |
The ApiKey property contains the game's PlayFab API key. It must be set and valid in order to use FireEvent. It can be set by pasting and editing the following line of code into the Command bar:
1
|
|
Security | LocalUserSecurity |
---|---|
Thread safety | ReadSafe |
Category | Data |
Loaded/Saved | true |
FireCustomEvent
Parameters (3) | ||
---|---|---|
player | Instance | |
eventCategory | string | |
customData | Variant | |
Returns (1) | ||
null |
This function triggers a custom event with a custom event name data.
Limits of events
Each game server is allowed a certain number of standard events API calls based on the number of players present (more players means more events will be needed). The events that exceed the limit will be dropped and log an error to the developer console. - Per minute limit: 120 + numPlayers * 20, all events shared this limit. - Cooldown: refresh every 10 seconds
Limits of parameters
Limit the size of parameters. The event that exceeds the limit will be dropped and log an error to the developer console.
Parameters | Maximum Number of Characters |
---|---|
customData Variant | 500 after serialized |
other string types | 50 |
See also:
- AnalyticsService:FirePlayerProgressionEvent(), triggers an event used to track player progression through the game
- AnalyticsService:FireInGameEconomyEvent(), triggers an event used to track player actions pertaining to the in-game economy
- AnalyticsService:FireLogEvent(), triggers an event used to track errors and warnings experienced by players
Thread safety | Unsafe |
---|
History 4
- 619 Change Tags of FireCustomEvent from [] to [Deprecated]
- 573 Change ReturnType of FireCustomEvent from void to null
- 462 Change ThreadSafety of FireCustomEvent from to Unsafe
- 457 Add FireCustomEvent
FireEvent
Parameters (2) | ||
---|---|---|
category | string | |
value | Variant | |
Returns (1) | ||
null |
FireEvent reports a custom event to PlayFab. The event is reported using a category and value, where the category is a string and the value can be a string or table. In order to use PlayFab, you must have a valid ApiKey set.
Possible Errors
- "AnalyticsService can only be executed by game server." – Tracking can only be done on the server through a Script or ModuleScript required by a script. See RunService:IsServer().
- "The ApiKey is invalid." – The ApiKey has been set, but it's invalid. Check that it is set to the correct value.
- "AnalyticsService can only accept valid UTF-8 characters." – Thrown when the value can't be serialized as UTF-8 characters. This can happen if you pass a value which has unicode characters, like emojis.
- "AnalyticsService failed in parse event value. Error: ..." – Thrown when there is an issue when serializing the provided value into a string.
- "AnalyticsService: , " and \r\n are not allowed in category." – The
comma
,
, the double quote"
, and newline characters\r\n
cannot be used in the category parameter. - "AnalyticsService: The event value you fired is too long." – Thrown if the value parameter was too long after serialization. The length limit is 1 KB, or 1024 bytes.
Thread safety | Unsafe |
---|
FireInGameEconomyEvent
Parameters (8) | ||
---|---|---|
player | Instance | |
itemName | string | |
economyAction | AnalyticsEconomyAction | |
itemCategory | string | |
amount | int | |
currency | string | |
location | Variant | |
customData | Variant | |
Returns (1) | ||
null |
This function triggers an event used to track player actions pertaining to the in-game economy.
For example, it should be called to track when players acquire or spend virtual items within the economy like currency.
Limits of events
Each game server is allowed a certain number of standard events API calls based on the number of players present (more players means more events will be needed). The events that exceed the limit will be dropped and log an error to the developer console. - Per minute limit: 120 + numPlayers * 20, all events shared this limit. - Cooldown: refresh every 10 seconds
Limits of parameters
Limit the size of parameters. The event that exceeds the limit will be dropped and log an error to the developer console.
Parameters | Maximum Number of Characters |
---|---|
customData Variant | 500 after serialized |
other string types | 50 |
See also:
- AnalyticsService:FirePlayerProgressionEvent(), triggers an event used to track player progression through the game
- AnalyticsService:FireLogEvent(), triggers an event used to track errors and warnings experienced by players
- AnalyticsService:FireCustomEvent(), triggers an event used to emit a custom event
Thread safety | Unsafe |
---|
History 4
- 619 Change Tags of FireInGameEconomyEvent from [] to [Deprecated]
- 573 Change ReturnType of FireInGameEconomyEvent from void to null
- 462 Change ThreadSafety of FireInGameEconomyEvent from to Unsafe
- 457 Add FireInGameEconomyEvent
FireLogEvent
Parameters (5) | ||
---|---|---|
player | Instance | |
logLevel | AnalyticsLogLevel | |
debugInfo | Variant | |
customData | Variant | |
Returns (1) | ||
null |
This function triggers an event used to track errors and warnings experienced by players.
For example, it could be called to indicate when a function call fails - such as a datastore save or TeleportService:Teleport(). See the example below.
Limits of events
Each game server is allowed a certain number of standard events API calls based on the number of players present (more players means more events will be needed). The events that exceed the limit will be dropped and log an error to the developer console. - Per minute limit: 120 + numPlayers * 20, all events shared this limit. - Cooldown: refresh every 10 seconds
Limits of parameters
Limit the size of parameters. The event that exceeds the limit will be dropped and log an error to the developer console.
Parameters | Maximum Number of Characters |
---|---|
FireLogEvent stackTrace | 1000 |
FireLogEvent message | 500 |
customData Variant | 500 after serialized |
other string types | 50 |
See also:
- AnalyticsService:FireInGameEconomyEvent(), triggers an event used to track player actions pertaining to the in-game economy
- AnalyticsService:FirePlayerProgressionEvent(), triggers an event used to track player progression through the game
- AnalyticsService:FireCustomEvent(), triggers an event used to emit a custom event
Thread safety | Unsafe |
---|
History 4
- 619 Change Tags of FireLogEvent from [] to [Deprecated]
- 573 Change ReturnType of FireLogEvent from void to null
- 462 Change ThreadSafety of FireLogEvent from to Unsafe
- 457 Add FireLogEvent
FirePlayerProgressionEvent
Parameters (6) | ||
---|---|---|
player | Instance | |
category | string | |
progressionStatus | AnalyticsProgressionStatus | |
location | Variant | |
statistics | Variant | |
customData | Variant | |
Returns (1) | ||
null |
This function triggers an event used to track player progression through the game.
For example, it should be called when a player starts an in-game tutorial and again that player finishes the tutorial. Another example (see below) includes tracking when a player gains experience, collects objects, and levels up.
Limits of events
Each game server is allowed a certain number of standard events API calls based on the number of players present (more players means more events will be needed). The events that exceed the limit will be dropped and log an error to the developer console. - Per minute limit: 120 + numPlayers * 20, all events shared this limit. - Cooldown: refresh every 10 seconds
Limits of parameters
Limit the size of parameters. The event that exceeds the limit will be dropped and log an error to the developer console.
Parameters | Maximum Number of Characters |
---|---|
FirePlayerProgressionEvent location | 5 pairs of Key and Value, each Key and Value are 50 |
FirePlayerProgressionEvent statistics | 5 pairs of Key and Value, each Key and Value are 50 |
customData Variant | 500 after serialized |
other string types | 50 |
See also:
- AnalyticsService:FireInGameEconomyEvent(), triggers an event used to track player actions pertaining to the in-game economy
- AnalyticsService:FireLogEvent(), triggers an event used to track errors and warnings experienced by players
- AnalyticsService:FireCustomEvent(), triggers an event used to emit a custom event
Thread safety | Unsafe |
---|
History 4
- 619 Change Tags of FirePlayerProgressionEvent from [] to [Deprecated]
- 573 Change ReturnType of FirePlayerProgressionEvent from void to null
- 462 Change ThreadSafety of FirePlayerProgressionEvent from to Unsafe
- 457 Add FirePlayerProgressionEvent
LogCustomEvent
Parameters (4) | Default | |
---|---|---|
player | Player | |
eventName | string | |
value | double | 1 |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event used to track custom metrics of a user in experience. For additional information, see Custom Events.
Thread safety | Unsafe |
---|
History 1
- 637 Add LogCustomEvent
LogEconomyEvent
Parameters (8) | Default | |
---|---|---|
player | Player | |
flowType | AnalyticsEconomyFlowType | |
currencyType | string | |
amount | float | |
endingBalance | float | |
transactionType | string | |
itemSku | string | |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event used to track player actions related in experience.
Thread safety | Unsafe |
---|
History 3
- 623 Change Parameters of LogEconomyEvent from (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, endingBalance: float, amount: float, transactionType: string, itemSku: string = , customFields: Dictionary = nil) to (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, amount: float, endingBalance: float, transactionType: string, itemSku: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogEconomyEvent from (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, endingBalance: float, amount: float, transactionType: string, itemSku: string, customFields: Array) to (player: Player, flowType: AnalyticsEconomyFlowType, currencyType: string, endingBalance: float, amount: float, transactionType: string, itemSku: string = , customFields: Dictionary = nil)
- 619 Add LogEconomyEvent
LogFunnelStepEvent
Parameters (6) | Default | |
---|---|---|
player | Player | |
funnelName | string | |
funnelSessionId | string | |
step | int | 1 |
stepName | string | |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event used to track user actions stepping through a pre-planned funnel. Funnel breakdowns will only consider the user and event values from the first step in a funnel session.
Thread safety | Unsafe |
---|
History 3
- 632 Change Parameters of LogFunnelStepEvent from (player: Player, funnelName: string, funnelSessionId: string = , step: int = 0, stepName: string = , customFields: Dictionary = nil) to (player: Player, funnelName: string, funnelSessionId: string = , step: int = 1, stepName: string = , customFields: Dictionary = nil)
- 622 Change Parameters of LogFunnelStepEvent from (player: Player, funnelName: string, step: int, customFields: Array) to (player: Player, funnelName: string, funnelSessionId: string = , step: int = 0, stepName: string = , customFields: Dictionary = nil)
- 619 Add LogFunnelStepEvent
LogOnboardingFunnelStepEvent
Parameters (4) | Default | |
---|---|---|
player | Player | |
step | int | |
stepName | string | |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event used to track user actions stepping through an onboarding funnel. Funnel breakdowns will only consider the user and event values from the first step in a funnel session.
Thread safety | Unsafe |
---|
History 2
- 622 Change Parameters of LogOnboardingFunnelStepEvent from (player: Player, step: int, customFields: Array) to (player: Player, step: int, stepName: string = , customFields: Dictionary = nil)
- 619 Add LogOnboardingFunnelStepEvent
LogProgressionCompleteEvent
Parameters (5) | Default | |
---|---|---|
player | Player | |
progressionPathName | string | |
level | int | |
levelName | string | |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event for when a user has completed a level attempt. This event does not currently display in any Roblox-provided charts.
Thread safety | Unsafe |
---|
History 2
- 622 Change Parameters of LogProgressionCompleteEvent from (player: Player, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, level: int, levelName: string = , customFields: Dictionary = nil)
- 619 Add LogProgressionCompleteEvent
LogProgressionEvent
Parameters (6) | Default | |
---|---|---|
player | Player | |
progressionPathName | string | |
status | AnalyticsProgressionType | |
level | int | |
levelName | string | |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event for when a user has started, completed, or failed a level attempt. This event does not currently display in any Roblox-provided charts.
Thread safety | Unsafe |
---|
History 2
- 622 Change Parameters of LogProgressionEvent from (player: Player, status: AnalyticsProgressionType, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, status: AnalyticsProgressionType, level: int, levelName: string = , customFields: Dictionary = nil)
- 619 Add LogProgressionEvent
LogProgressionFailEvent
Parameters (5) | Default | |
---|---|---|
player | Player | |
progressionPathName | string | |
level | int | |
levelName | string | |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event for when a user has failed a level attempt. This event does not currently display in any Roblox-provided charts.
Thread safety | Unsafe |
---|
History 2
- 622 Change Parameters of LogProgressionFailEvent from (player: Player, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, level: int, levelName: string = , customFields: Dictionary = nil)
- 619 Add LogProgressionFailEvent
LogProgressionStartEvent
Parameters (5) | Default | |
---|---|---|
player | Player | |
progressionPathName | string | |
level | int | |
levelName | string | |
customFields | Dictionary | nil |
Returns (1) | ||
null |
Logs an event for when a user has started a level attempt. This event does not currently display in any Roblox-provided charts.
Thread safety | Unsafe |
---|
History 2
- 622 Change Parameters of LogProgressionStartEvent from (player: Player, level: int, levelName: string, customFields: Array) to (player: Player, progressionPathName: string, level: int, levelName: string = , customFields: Dictionary = nil)
- 619 Add LogProgressionStartEvent
Removed members 13
GetClientId
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 364 Add GetClientId
GetSessionId
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
string |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 364 Add GetSessionId
ReleaseRBXEventStream
Parameters (1) | ||
---|---|---|
target | string | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 335 Add ReleaseRBXEventStream
ReportCounter
Parameters (2) | Default | |
---|---|---|
counterName | string | |
amount | int | 1 |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 269 Add ReportCounter
ReportInfluxSeries
Parameters (3) | ||
---|---|---|
seriesName | string | |
points | Dictionary | |
throttlingPercentage | int | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 310 Add ReportInfluxSeries
ReportStats
Parameters (2) | ||
---|---|---|
category | string | |
value | float | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 269 Add ReportStats
SendEventDeferred
Parameters (4) | ||
---|---|---|
target | string | |
eventContext | string | |
eventName | string | |
additionalArgs | Dictionary | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 348 Add SendEventDeferred
SendEventImmediately
Parameters (4) | ||
---|---|---|
target | string | |
eventContext | string | |
eventName | string | |
additionalArgs | Dictionary | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 348 Add SendEventImmediately
SetRBXEvent
Parameters (4) | ||
---|---|---|
target | string | |
eventContext | string | |
eventName | string | |
additionalArgs | Dictionary | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 3
- 386 Remove AnalyticsService
- 269 Change Parameters of SetRBXEvent from (eventContext: string, eventName: string, additionalArgs: Dictionary) to (target: string, eventContext: string, eventName: string, additionalArgs: Dictionary)
- 268 Add SetRBXEvent
SetRBXEventStream
Parameters (4) | ||
---|---|---|
target | string | |
eventContext | string | |
eventName | string | |
additionalArgs | Dictionary | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 276 Add SetRBXEventStream
TrackEvent
Parameters (4) | Default | |
---|---|---|
category | string | |
action | string | |
label | string | |
value | int64 | 0 |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 3
- 386 Remove AnalyticsService
- 325 Change Parameters of TrackEvent from (category: string, action: string, label: string) to (category: string, action: string, label: string, value: int64 = 0)
- 291 Add TrackEvent
TrackEventWithArgs
Parameters (5) | Default | |
---|---|---|
category | string | |
action | string | |
label | string | |
args | Dictionary | |
value | int64 | 0 |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 377 Add TrackEventWithArgs
UpdateHeartbeatObject
Parameters (1) | ||
---|---|---|
args | Dictionary | |
Returns (1) | ||
void |
Security | RobloxScriptSecurity |
---|
History 2
- 386 Remove AnalyticsService
- 270 Add UpdateHeartbeatObject