Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions features/emails.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -564,11 +564,11 @@ Each Trophy metric supports the following email variables:

- **Metric Name**: The name of the metric
- **Metric Units**: The metric's units
- **Current Total**: The sum of all the recipients event values to date
- **Change This Period**: Absolute change in the recipients current total in the current aggregation period
- **Change This Period (%)**: Percent change in the recipients current total in the current aggregation period
- **Percentile (All Time)**: The recipients current total compared to all other users for all time
- **Percentile (This Period)**: The recipients current total compared to all other users in the current aggregation period
- **Current Total**: The sum of all the recipient's event values to date
- **Change This Period**: Absolute change in the recipient's current total in the current aggregation period
- **Change This Period (%)**: Percent change in the recipient's current total in the current aggregation period
- **Percentile (All Time)**: The recipient's current total compared to all other users for all time
- **Percentile (This Period)**: The recipient's current total compared to all other users in the current aggregation period

Additionally, the **Highest** and **Lowest** dynamic aliases support the same set of variables. When using these aliases, Trophy will pick the metric where the recipient has either the highest or lowest current total at send time.

Expand All @@ -580,11 +580,11 @@ When using metric variables, you also have the option of filtering the data that

Similarly to metrics, each points system has the following variables that can be used to add dynamic data to email copy:

- **Current Total**: The recipients total points
- **Change This Period**: Absolute change in the recipients total points in the current aggregation period
- **Change This Period (%)**: Percent change in the recipients total points in the current aggregation period
- **Percentile (All Time)**: The recipients total points compared to all other users for all time
- **Percentile (This Period)**: The recipients total points compared to all other users in the current aggregation period
- **Current Total**: The recipient's total points
- **Change This Period**: Absolute change in the recipient's total points in the current aggregation period
- **Change This Period (%)**: Percent change in the recipient's total points in the current aggregation period
- **Percentile (All Time)**: The recipient's total points compared to all other users for all time
- **Percentile (This Period)**: The recipient's total points compared to all other users in the current aggregation period

.

Expand Down Expand Up @@ -643,7 +643,7 @@ There are a couple of additional options to consider when using emails variables

**Prefix & Suffix**

You can provide a prefix and suffix for text variables like the recipients name, or the name of a particular metric.
You can provide a prefix and suffix for text variables like the recipient's name, or the name of a particular metric.

<Frame>
<img
Expand All @@ -658,7 +658,7 @@ If the value of the variable fails to render when the email is sent, then Trophy

**Singular & Plural**

When using numeric variables like the recipients current points total or metric total, you can also provide a singular and plural suffix to accompany it.
When using numeric variables like the recipient's current points total or metric total, you can also provide a singular and plural suffix to accompany it.

<Frame>
<img
Expand Down
4 changes: 2 additions & 2 deletions features/events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ The value of an event can be positive or negative, and can be a whole number or

You can specify a number of custom event attributes to help you track additional information relevant to your use case against events you send to Trophy.

For example, a language learning app might have a 'Questions Completed' metric and use a custom event attribute to store wether the answer to each question was correct.
For example, a language learning app might have a 'Questions Completed' metric and use a custom event attribute to store whether the answer to each question was correct.

Similarly a fitness app might use an 'Exercises Completed' metric and use a custom event attribute to store the weight that was used in each exercise and another custom event attribute to store how long the exercise lasted.

Expand Down Expand Up @@ -169,7 +169,7 @@ Each metric has a unique `key` which you can use to reference and track events a

To start tracking user interactions as events against your Trophy metrics, use the [Metrics API](/api-reference/endpoints/metrics/send-a-metric-change-event) or one of our type-safe [Client SDKs](/api-reference/client-libraries) supported in most major programming languages.

Here's an example where a fictional study platform is using a metric to track the number of flashcards flipped by each student. Each time an student interacts, the platform sends an event to Trophy telling it how many flashcards they viewed:
Here's an example where a fictional study platform is using a metric to track the number of flashcards flipped by each student. Each time a student interacts, the platform sends an event to Trophy telling it how many flashcards they viewed:

<MetricChangeRequestBlock />

Expand Down
2 changes: 1 addition & 1 deletion features/leaderboards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ In this section we outline the different types of leaderboards supported in Trop

### Perpetual Leaderboards {#perpetual-leaderboards}

Perpetual leaderboards never reset. Once started they continually track and rank users progress over time forever, or until the configured [end date](#end-dates).
Perpetual leaderboards never reset. Once started they continually track and rank users' progress over time forever, or until the configured [end date](#end-dates).

Use perpetual leaderboards when you want to create all-time rankings of user activity.

Expand Down
2 changes: 1 addition & 1 deletion features/users.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;

Custom user attributes are managed by you and can be anything you like based on your use case.

For example a language learning app might use a custom user attribute for the language a user is learning, or a study platform might use one for the users favourite subject.
For example a language learning app might use a custom user attribute for the language a user is learning, or a study platform might use one for the user's favourite subject.

Custom user attributes let you tell Trophy about this contextual information and use it to personalize gamification features.

Expand Down
6 changes: 3 additions & 3 deletions guides/gamified-study-platform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ Next, we'll add some UI to show off our gamification features in practice.

### Adding Gamification UX {#adding-gamification-ux}

The response to the API call that we make to track events in Trophy helpfully gives us back any changes to the users progress as a result of that event:
The response to the API call that we make to track events in Trophy helpfully gives us back any changes to the user's progress as a result of that event:

<MetricChangeResponseBlock />

Expand All @@ -975,7 +975,7 @@ This includes:
- The `achievements` array which is a list of newly unlocked achievements as a result of the event.
- The `currentStreak` object which is the users most up to date streak data after the event has taken place.

This makes it really easy for us to react to changes in the users progress and do whatever we want. In this example, each time Trophy tells us a user has unlocked a new achievement, or extended their streak we'll:
This makes it really easy for us to react to changes in the user's progress and do whatever we want. In this example, each time Trophy tells us a user has unlocked a new achievement, or extended their streak we'll:

- Show a pop-up toast
- Play a sound effect
Expand Down Expand Up @@ -1416,7 +1416,7 @@ export default function Flashcards({ flashcards }: Props) {

The last piece of UI we'll add will be a dialog to display the user's study progress, including their streak and any achievements they've unlocked so far.

First, we'll add a couple of new server actions to fetch the users streak and achievements from Trophy. As we're using a daily streak here, we'll fetch the last 14 days of streak data from Trophy to give us enough to work with in our UI:
First, we'll add a couple of new server actions to fetch the user's streak and achievements from Trophy. As we're using a daily streak here, we'll fetch the last 14 days of streak data from Trophy to give us enough to work with in our UI:

```tsx src/app/actions.ts [expandable] {6-7,10-11,24,33,45-58,60-73}
"use server";
Expand Down
4 changes: 2 additions & 2 deletions guides/how-to-build-a-leaderboards-feature.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,15 @@ Use the [user leaderboard API](/api-reference/endpoints/users/get-a-users-leader

<UserLeaderboardRankingsRequest />

Here's an example of the data returned from the user leaderboard rankings API which includes the users current rank in the `rank` attribute and an array of previous ranks in the `history` attribute:
Here's an example of the data returned from the user leaderboard rankings API which includes the user's current rank in the `rank` attribute and an array of previous ranks in the `history` attribute:

<UserLeaderboardRankingsResponse />

## Analytics {#analytics}

The [leaderboards page](https://app.trophy.so/achievements) in Trophy shows how many users are actively participating in a leaderboard, as well as a measure of competitiveness based on how many rank changes are occurring.

The analytics page also shows a distribution of users scores to help identify clusters of users within rankings.
The analytics page also shows a distribution of users' scores to help identify clusters of users within rankings.

<Frame>
<img
Expand Down
2 changes: 1 addition & 1 deletion guides/how-to-build-a-streaks-feature.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ To track an event (user interaction) against your metric, use the [metric change
awkward edge cases where users change time zones.
</Tip>

The response to this API call is the complete set of changes to any features you've built with Trophy, including the latest data on the users streak.
The response to this API call is the complete set of changes to any features you've built with Trophy, including the latest data on the user's streak.

{/* vale off */}

Expand Down
Loading