Blog

Latest news and updates from the PlayFab developers

by JamesGwertzman 2014-09-27

Announcing Integration with Segment.io

I'm super excited to announce our newest feature -- the ability to send PlayFab analytics event data to Segment.io, which in turn can then route that data to nearly 120 other companies, including companies that do analytics, marketing automation, CRM, advertising, error reporting, and user testing. Our goal at PlayFab is to provide a broad, one-stop game operations platform, and we know there will always be other companies who specialize in doing specific tasks better than we do. Now with our Segment.io integration, you can integrate your game with these third party services in just a few minutes with zero code!

Screen Shot 2014-09-27 at 2.53.01 PM

To set this up, first create an account on Segment.io and create a new project. Then view the project settings, click "API Keys", and copy the "Write Key". Next, log into the PlayFab game manager, and click the Settings menu. Choose "Properties" and then click the "Segment.io" tab. Paste in the Write Key.

Screen Shot 2014-09-27 at 2.58.20 PM

That's it! Now events from your game will start flowing into Segment.io. You can see them by clicking on the Debugger. You should see a flow of events flowing by from your game. You will notice that there are two different kinds of events:

  • Identify. This sends information about your players, including username, email address, IP address, MAC address, and account creation time.
  • Track. This is called for all the other events that get tracked, and contains different information based on the events.

Here is a list of all the events that PlayFab is set up to send to Segment.io: (this list will grow over time)

  • user_logged_in. Called when player logs in through any of LoginWithAndroidDeviceID, LoginWithFacebook, LoginWithGoogleAccount, LoginWithIOSDeviceID, LoginWithPlayFab, LoginWithSteam. Also initiates an Identify event.
  • user_added_title. Called when player has logged into your game for the first time, thus associating their ID with your game.
  • user_purchase_completed. Called when player completes a purchase, including ConfirmPurchase, PurchaseItem, ValidateIOSReceipt and ValidateGooglePlayPurchase APIs). Includes the order ID, transaction status, price, currency, and catalog item name.
  • user_inventory_item_created. Called when an item is added to player's inventory through a purchase. Includes the item ID, order ID, unit price, currency, usage count, object name, class name, catalog version.
  • user_granted_item. Called when an item is explicitly granted directly to a player through GrantItemsToUsers.
  • user_consumed_item_use. Called when a consumable item is consumed through ConsumeItem. Includes the item ID, object name, catalog version, # of uses consumed, and remaining usage count.
  • user_redeemed_coupon. Called when a coupon is redeemed for an item through RedeemCoupon.
  • user_unlocked_container_item. Called when a container is unlocked through UnlockContainerItem and the contents are added to the player's inventory.
  • user_added_virtualcurrency. Called when virtual currency gets added to the player's account.
  • user_subtracted_virtualcurrency. Called when virtual currency is removed from the player's account.
  • user_added_friend. Called when a player adds a friend through AddFriend. Includes the friend user ID, and friend display name.
  • user_removed_friend. Called when a player removes a friend through RemoveFriend.
  • game_started
  • match_made
  • all custom events that your game might generate using the LogEvent method.

Once you've verified that data is flowing into Segement.io, then the fun part begins -- turning on integration with one or more third party integrations! For example, we are using the integration with Customer.io in order to enable email automation for PlayFab developers. If you signed up with PlayFab recently you should have received an email from the PlayFab Developer Relations team welcoming you to PlayFab. That mail was sent by Customer.io, via events send through our Segment.io integration. The possibilities are endless:

  • Send emails or push notifications to your players based on their in-game actions.
  • Import player information into a CRM system, allowing you to manage your relationships with your top customers more carefully.
  • Import event data into one of several advanced analytics providers to do more detailed analytics than PlayFab currently provides.
  • Import your players into a MailChimp mailing list and send out periodic customer newsletters.

We have already requested that Segment.io add support for Urban Airship and Swrve, two popular services that game developers often use. If you decide to try out Segment.io, please let us know how it goes! We really want your feedback on this new feature.