Using PlayFab Analytics

Using PlayFab Analytics

5 min

One of the easiest ways to monitor and improve your game post-launch is through articles/introduction to analytics|analytics, using the built-in AnalyticsService along with PlayFab.

PlayFab Setup

Obtaining an API Key

If you are part of the PlayFab beta, you’ll receive an email with a link to register an account. Once you’ve done so, log in to your PlayFab dashboard. You can find the API key for your game right below the game title.

Adding Users

To add more users from your PlayFab dashboard:

  1. Go to the main page of the dashboard.
  2. Click on the icon to the right of the studio name and select Users from the dropdown.
  3. On the next page, click ADD USER.

AnalyticsService Setup

To begin using AnalyticsService, you’ll need to set the API key as follows:

  1. In Roblox Studio, open the Command Bar from the View tab.
  2. Enter the following commands to set the AnalyticsService/ApiKey|AnalyticsService.ApiKey property (replace API_KEY with your unique API key). This will store the key to be sent with all future events.

Sending Events

AnalyticsService allows you to report custom in-game events, including anything from players choosing their favorite battlefield to how often they use one item/object over another.

To report a custom event to PlayFab, use the AnalyticsService/FireEvent|FireEvent() method from a Script or ModuleScript, specifying both a category and value. Note that the value passed can be either a string, number, or a table of values.

As you can see, analytics help you monitor player behavior and fine-tune the game experience. Now that you understand how to connect PlayFab, please explore fundamental concepts in the articles below.

  • analytics
  • retention
  • marketing