Getting a player’s Value-to-Date (VTD) (Legacy Economy)
Economy v1 APIs are in maintenance mode and will not be receiving any new features, only bug fixes. The v1 APIs will be maintained for the foreseeable future. See the Economy v2 Overview to learn more about the next version of PlayFab Economy!
PlayerProfileModel, a player’s VTD is tracked in two different fields:
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).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. TheTotalValuefield in each object expresses the total for that currency as a whole number of 1/100 monetary units.
Using VTD to define player segments
In the PlayFab Game Manager, you can use either totalValueToDateInUSD or valuesToDate as segment predicates - criteria that can be used to define player segments. When creating or editing a player segment, the two predicates are included in the dropdown list:- Total value to date in USD - The
TotalValueToDateInUSDvalue. - Value to date - The
ValuesToDatetotals. When you select this predicate, you’ll 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.- Create a segment of all players who have purchased more than 15 USD in any currency.
- Create a segment of all players who have spent more than 15 USD in any currency or 15 Chinese Yuan.
