Getting a player's Value-to-Date (VTD) (Legacy Economy)
Important
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!
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:
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. TheTotalValue
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 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
TotalValueToDateInUSD
value. - Value to date - The
ValuesToDate
totals. 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 more than 15 USD in any currency or 15 Chinese Yuan.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for