Skip to content
Roblox API Reference

AnalyticsService

Collection of methods that allows you to track how users interact with your experiences.
  • Not creatable
  • Not replicated
  • Service
Memory category
Instances
Own members
17
Inherited members
75
Subclasses
0
Siblings
608

Properties24

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Defined byAnalyticsService1

Property categoryData

  • AnalyticsService.ApiKey: string = ""
    Deprecated: This property is deprecated. Do not use it for new work.
    PlayFab API key. Must be set in order to use FireEvent.
    • Deprecated
    • Local user security
    • Read capabilities: Basic

Methods58

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byAnalyticsService16
  • AnalyticsService:GetDurationLoggerTimestamp(): number
    • Capabilities: Basic + InternalTest
    Returns
    Type
    number
  • AnalyticsService:GetPlayerSegmentsAsync(player: Player): { [string]: any }
    Returns coarse player segment buckets for the current experience.
    • Yields
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The player whose segment buckets should be returned.
    Returns
    TypeDescription
    { [string]: any }
    A dictionary containing coarse player segment buckets for the current experience.
  • AnalyticsService:LogCustomEvent(player: Player,eventName: string,value: number? = 1,customFields: { [string]: any }? = nil,)
    Logs an event used to track custom metrics of a user in experience.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The user who triggered the event.
    eventName: string
    The name of the custom event.
    value: number? = 1
    The value of the event that will be used in aggregation.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogEconomyEvent(player: Player,flowType: Enum.AnalyticsEconomyFlowType,currencyType: string,amount: number,endingBalance: number,transactionType: string,itemSku: string? = "",customFields: { [string]: any }? = nil,)
    Logs an event used to track player actions related in experience.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The user who triggered the event.
    flowType: Enum.AnalyticsEconomyFlowType
    Should specify the direction that currency is flowing using AnalyticsEconomyFlowType.
    currencyType: string
    The name of the currency being added or removed, for example "gold", "gems", or "energy". Limited to 5 unique currency types per experience.
    amount: number
    The amount of currency being added or removed. This value should always be positive.
    endingBalance: number
    The user's balance after the currency has been added or removed. This value should always be greater than or equal to 0.
    transactionType: string
    The type of transaction that occurred. While you're free to use any transaction type, it's recommended to use the provided types from AnalyticsEconomyTransactionType such as "IAP" or "ContextualPurchase" to enable future insights from Roblox tools and charts. Because this field type is a string, you'll need to pass the Name value of the enum. For example Enum.AnalyticsEconomyTransactionType.IAP.Name. Limited to 20 unique types per experience.
    itemSku: string? = ""
    Optional SKU of the item or bundle being purchased. This is a unique identifier for the item being purchased. Limited to 100 unique SKUs per experience.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogFunnelStepEvent(player: Player,funnelName: string,funnelSessionId: string? = "",step: number? = 1,stepName: string? = "",customFields: { [string]: any }? = nil,)
    Logs an event used to track user actions stepping through a pre-planned funnel.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The user who triggered the event.
    funnelName: string
    The name of the funnel. This should be the same for all steps in the funnel. Limited to 10 unique funnels per experience.
    funnelSessionId: string? = ""
    Optional unique identifier for the funnel session. This should be the same for all steps in the funnel. Note that this field is only necessary for recurring funnels, for example a purchase flow funnel or an item upgrade funnel. If you don't have a natural funnel session identifier, it's recommended to use HttpService:GenerateGUID().
    step: number? = 1
    The step number in the funnel. This should be unique for each step in the funnel. All funnels start at step 1. Limited to steps 1-100. Repeated steps by the same user in the same funnel session, or when funnelSessionId is nil will be ignored. Note that if any steps are skipped, the intermediate steps will be considered completed.
    stepName: string? = ""
    Optional name of the step in the funnel. This field is only used for display purposes in Roblox-provided charts.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogJourneyEvent(player: Player,journeyName: string,nodeName: string,journeySessionId: string? = "",customFields: { [string]: any }? = nil,)
    Logs a journey event used to track non-linear player paths through an experience.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The player who triggered the journey event.
    journeyName: string
    The name of the journey. This should be the same for all nodes in the journey. Cannot be empty and cannot contain a comma ,, double quote ", single quote ', or newline character.
    nodeName: string
    The name of the node the player reached in the journey. Cannot be empty, cannot contain a comma ,, double quote ", single quote ', or newline character, and cannot start with __ (double underscore), which is reserved.
    journeySessionId: string? = ""
    Optional unique identifier for the journey session. This should be the same for all nodes in a single session of the journey. If provided, cannot contain a comma ,, double quote ", single quote ', or newline character.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogOnboardingFunnelStepEvent(player: Player,step: number,stepName: string? = "",customFields: { [string]: any }? = nil,)
    Logs an event used to track user actions stepping through an onboarding funnel.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The user who triggered the event.
    step: number
    The step number in the funnel. This should be unique for each step in the funnel. All funnels start at step 1. Limited to steps 1-100. Note that if any steps are skipped, the intermediate steps will be considered completed.
    stepName: string? = ""
    Optional name of the step in the funnel. This field is only used for display purposes in Roblox-provided charts.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogProgressionCompleteEvent(player: Player,progressionPathName: string,level: number,levelName: string? = "",customFields: { [string]: any }? = nil,)
    Logs an event for when a user has completed a level attempt.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The player who triggered the event.
    progressionPathName: string
    The name of the progression path this event belongs to, such as a world, chapter, or level group. This groups related progression events together. Cannot be empty and cannot contain a comma ,, double quote ", single quote ', or newline character.
    level: number
    The numeric level the player is progressing through within the progression path.
    levelName: string? = ""
    The name of the level associated with this event. This field is used for display purposes in Roblox-provided charts.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogProgressionEvent(player: Player,progressionPathName: string,status: Enum.AnalyticsProgressionType,level: number,levelName: string? = "",customFields: { [string]: any }? = nil,)
    Logs an event for when a user has started, completed, or failed a level attempt.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The player who triggered the event.
    progressionPathName: string
    The name of the progression path this event belongs to, such as a world, chapter, or level group. This groups related progression events together. Cannot be empty and cannot contain a comma ,, double quote ", single quote ', or newline character.
    status: Enum.AnalyticsProgressionType
    The progression status to record, provided as an AnalyticsProgressionType value such as Start, Complete, or Fail. The AnalyticsService:LogProgressionStartEvent(), AnalyticsService:LogProgressionCompleteEvent(), and AnalyticsService:LogProgressionFailEvent() methods are shortcuts that set this status for you.
    level: number
    The numeric level the player is progressing through within the progression path.
    levelName: string? = ""
    The name of the level associated with this event. This field is used for display purposes in Roblox-provided charts.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogProgressionFailEvent(player: Player,progressionPathName: string,level: number,levelName: string? = "",customFields: { [string]: any }? = nil,)
    Logs an event for when a user has failed a level attempt.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The user who triggered the event.
    progressionPathName: string
    The name of the progression path this event belongs to, such as a world, chapter, or level group. This groups related progression events together. Cannot be empty and cannot contain a comma ,, double quote ", single quote ', or newline character.
    level: number
    The numeric level the player is progressing through within the progression path.
    levelName: string? = ""
    The name of the level associated with this event. This field is used for display purposes in Roblox-provided charts.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:LogProgressionStartEvent(player: Player,progressionPathName: string,level: number,levelName: string? = "",customFields: { [string]: any }? = nil,)
    Logs an event for when a user has started a level attempt.
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Player
    The player who triggered the event.
    progressionPathName: string
    The name of the progression path this event belongs to, such as a world, chapter, or level group. This groups related progression events together. Cannot be empty and cannot contain a comma ,, double quote ", single quote ', or newline character.
    level: number
    The numeric level the player is progressing through within the progression path.
    levelName: string? = ""
    The name of the level associated with this event. This field is used for display purposes in Roblox-provided charts.
    customFields: { [string]: any }? = nil
    Optional dictionary of custom fields that will provide breakdowns in Roblox-provided charts. Only specific keys, provided by AnalyticsCustomFieldKeys, will be used for these breakdowns. Limited to 8,000 unique combinations of values across the three custom fields per experience.
  • AnalyticsService:FireCustomEvent(player: Instance,eventCategory: string,customData: any,)
    Deprecated: This deprecated function is a variant of AnalyticsService:LogCustomEvent() which should be used instead.
    Fires a custom event with a custom event name and data.
    • Deprecated
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Instance
    The player who triggered the custom event. nil if not player related.
    eventCategory: string
    User defined category. This should be the name of the event.
    customData: any
    Optional. User defined data, could be a string, a number or a table.
  • AnalyticsService:FireEvent(category: string, value: any)
    Deprecated: This function has been deprecated in favor of more descriptive methods, including AnalyticsService:LogCustomEvent(), AnalyticsService:LogEconomyEvent(), and AnalyticsService:LogProgressionEvent().
    Report a custom event to PlayFab.
    • Deprecated
    • Capabilities: Basic
    Parameters
    ParameterDescription
    category: string
    'The category of event to report. Cannot contain the following characters: comma ,, double quote " or newline characters \r\n'.
    value: any
    A value to be serialized and reported. Serialized length must not exceed 1 KiB, or 1024 bytes.
  • AnalyticsService:FireInGameEconomyEvent(player: Instance,itemName: string,economyAction: Enum.AnalyticsEconomyAction,itemCategory: string,amount: number,currency: string,location: any,customData: any,)
    Deprecated: This deprecated function is a variant of AnalyticsService:LogEconomyEvent() which should be used instead.
    Fire an event used to track player actions pertaining to the in-game
    • Deprecated
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Instance
    The player who triggered the economy event.
    itemName: string
    The name of the item.
    economyAction: Enum.AnalyticsEconomyAction
    Indicates the acquisition or spending of an in game resource.
    itemCategory: string
    A user defined category for items such as "Vehicle," "Weapon.".
    amount: number
    The amount of the currency.
    currency: string
    The currency used. Examples: 'gold', 'gems', 'life.'.
    location: any
    The event location. A dictionary that each key-value represents an entry of location data. The key-value is a string-string pair. With this you can query which are the most popular "stores" then maybe you want to increase/lower the price for the stores. See the example below:
    local location = {     ["placeDesc"] = "Dungeon1",     ["levelDesc"] = "level2",     ["mapDesc"] = "LeftChamberMap",     ["storeName"] = "DarkSmith",     ["userDefinedKey"] = "0005" }
    customData: any
    Optional. User defined data, could be a string, a number or a table.
  • AnalyticsService:FireLogEvent(player: Instance,logLevel: Enum.AnalyticsLogLevel,message: string,debugInfo: any,customData: any,)
    Deprecated: This method is deprecated. Do not use it for new work.
    Fire a log event used to track errors and warnings experienced by players.
    • Deprecated
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Instance
    The player who triggered the error event, nil if not player related.
    logLevel: Enum.AnalyticsLogLevel
    The specified log level (e.g. Debug, Error).
    message: string
    User defined message.
    debugInfo: any
    Optional. A dictionary which contains predefined keys including "errorCode" and "stackTrace". Both keys values are strings. stackTrace is a traceback of the current function call stack.
    customData: any
    Optional. User defined data, could be a string, a number or a table.
  • AnalyticsService:FirePlayerProgressionEvent(player: Instance,category: string,progressionStatus: Enum.AnalyticsProgressionStatus,location: any,statistics: any,customData: any,)
    Deprecated: This deprecated function is a variant of AnalyticsService:LogProgressionEvent() which should be used instead.
    Fire an event used to track player progression through the game.
    • Deprecated
    • Capabilities: Basic
    Parameters
    ParameterDescription
    player: Instance
    The player who triggered the event.
    category: string
    A user defined category for progression.
    progressionStatus: Enum.AnalyticsProgressionStatus
    Indicates the status of the progression.
    location: any
    The event location. A dictionary that each key-value represents an entry of location data. The key-value is a string-string pair. With this developers can query where is the most frequent location for a specific progression event category. For example, the category could be "LevelUp".
    statistics: any
    Optional. A dictionary that each key-value represents an entry of statistics data that allows developers to track any specific data that they want to collect as players progress through their game. Key-Value is a string-number pair.
    customData: any
    Optional. User defined data, could be a string, a number or a table.

Events10

Inherited fromObject1
Inherited fromInstance9