Getting a player's Value-to-Date (VTD)

PlayFab tracks the total amount spent by a player in the player profile model, which is retrieved by calling the GetPlayerProfile API.

Within the PlayerProfileModel, a player's VTD is tracked in two different fields:

  1. totalValueToDateInUSD - The sum of the player's purchases made with real-money currencies, converted to the US dollars (USD) equivalent and represented as a whole number of cents (1/100 USD).
  2. valuesToDate - An array of ValueToDateModel objects that contain the player's lifetime purchase totals, summed for each real-money currency in which they have made a purchase. The TotalValue field in each object expresses the total for that currency as a whole number of 1/100 monetary units.

The following JSON, shows these two fields with example values.

{
    …
    totalValueToDateInUSD: 1700
    valuesToDate: [{ "USD", 1200 }, { "EUR", 320 }]
    …
}

Using VTD to define player segments

In the PlayFab Game Manager, you can use either of the VTD totals described above as segment predicates - criteria that can be used to define player segments.

When you are creating or editing a player segment, you will see the two predicates (listed below) included in the dropdown list:

  1. Total value to date in USD - The TotalValueToDateInUSD value.
  2. Value to date - The ValuesToDate totals. When you select this predicate, you will see additional fields to specify the currency and the amount for that currency.

Segment examples

The following examples show segments created using each of the VTD totals.

  1. Create a segment of all players who have purchased more than 15 USD in any currency.

    Create a Segment - Mid Rollers - Filter 1

  2. Create a segment of all players who have spent more more than 15 USD in any currency or 15 Chinese Yuan.

    Create a Segment - Mid Rollers - Filter 2