> ## Documentation Index
> Fetch the complete documentation index at: https://docs.upstackdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Earn Virtual Currency: Track In-App Rewards

> Track Earn Virtual Currency events to measure in-app reward engagement. Analyze loyalty points, credits, and virtual currency earned across your site.

<Tip>
  Earn Virtual Currency counts the number of times visitors earn virtual currency, loyalty points, credits, or other in-app rewards on your site.
</Tip>

## Formula

<Info>
  **Earn Virtual Currency** = **COUNT** ( earn\_virtual\_currency events )
</Info>

### Formula Components

| Metric                             | Definition                                                                                |
| ---------------------------------- | ----------------------------------------------------------------------------------------- |
| **earn\_virtual\_currency events** | Individual events fired when a visitor earns virtual currency, loyalty points, or rewards |

| Metadata        |                         |
| --------------- | ----------------------- |
| **Type**        | Number                  |
| **Data Source** | [Upstack Pixel](/pixel) |
| **Aggregation** | Count                   |

***

## Example

Your loyalty program generated **4,892 earn events** last month as customers accumulated rewards:

| Reward Type     | Earn Events | Avg Value |
| --------------- | ----------- | --------- |
| Purchase Points | 2,340       | 150 pts   |
| Referral Bonus  | 890         | 500 pts   |
| Review Rewards  | 1,120       | 50 pts    |
| Birthday Bonus  | 542         | 200 pts   |

***

## How It Works

The Upstack Pixel fires an `earn_virtual_currency` event when a visitor earns virtual currency, loyalty points, or credits through actions like completing purchases, referring friends, or participating in promotions. Each event captures the currency type and amount earned, enabling you to analyze reward program engagement and identify which earning mechanisms drive the most participation.

***

## When to Use

| Scenario                     | Action                                                            |
| ---------------------------- | ----------------------------------------------------------------- |
| Measure loyalty engagement   | Track how often customers earn rewards to evaluate program health |
| Identify top earning actions | Find which activities generate the most reward events             |
| Optimize reward structure    | Compare earning rates across different reward mechanisms          |
| Segment high-value customers | Identify customers who actively accumulate rewards                |

***

## Related Metrics

| Metric                                                             | Relationship                                   |
| ------------------------------------------------------------------ | ---------------------------------------------- |
| Spend Virtual Currency                                             | Tracks when customers redeem earned rewards    |
| [Custom Events](/reference/metrics/funnel/engagement/custom-event) | Generic event tracking for custom interactions |
| [Purchases](/reference/metrics/funnel/conversions/purchases)       | Often triggers earn virtual currency events    |

[See all Engagement metrics →](/reference/metrics/funnel/engagement)
