earn_virtual_currency
RecommendedThis event measures the awarding of virtual currency. Log this along with spend_virtual_currency to better understand your virtual economy.
- Platforms
- web, app
- When it fires
- You send it when the action happens.
Parameters (2)
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| virtual_currency_name | string | No | The name of the virtual currency. | Gems |
| value | number | No | The value of the virtual currency. | 5 |
Example
gtag.js
gtag('event', 'earn_virtual_currency', {
virtual_currency_name: 'Gems',
value: 5,
});GTM dataLayer
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'earn_virtual_currency',
virtual_currency_name: 'Gems',
value: 5,
});