Pre-requisites
- A Trophy account
- About 10 minutes
Trophy Setup
In Trophy, Metrics are the building blocks of gamification and model the different interactions users make with your product. In this guide the interaction we’re interested in isflashcards-viewed, but you can create any number of metrics that best represents the interactions you want to reward XP from.
In the Trophy dashboard, head to the metrics page and create a metric.
Installing Trophy SDK
To interact with Trophy from your code you’ll use the Trophy SDK available in most major programming languages. Install the Trophy SDK:Tracking User Interactions
To track an event (user interaction) against your metric, use the metric change API.If you use Points Levels, the
xp object can include a level field only when the user’s tier changed on this request; it may be omitted when their level stayed the same. See the metric change API reference for the full response schema.Response
Displaying XP
You have a number of options for displaying XP in your application. Here we’ll look at the most common options.Pop-up Notifications
We can use the response of the metric change API to show users pop-up notifications when users are awarded new XP. Here’s an example of this in action:XP Pop-ups
Displaying User XP
To fetch a users XP use the user points API.awards query parameter.
Response

User XP Chart
The user points summary API returns chart-ready historical data for displaying how a user’s XP has changed over time.aggregation, start_date and end_date query parameters to control the data returned. Here’s an example of XP data aggregated daily:
GET /users/{id}/points/{key}/event-summary — 200 response

Analytics
In Trophy your xp system page, includes analytics charts that shows data on total XP earned and a breakdown of exactly what triggers award the most XP.