Overview
Subscription revenue tracking allows you to monitor recurring monetization from subscription packages in your game. The Keewano SDK provides dedicated methods to track revenue from subscription billing and items granted to subscribers.
The Two Subscription Steps
Tracking subscription revenue involves two steps:
Step 1: ReportSubscriptionRevenue - Track Subscription Billing
Use KeewanoSDK.ReportSubscriptionRevenue() to log revenue when a subscription starts or renews.
All revenue is stored in USD on Keewano servers. Choose one of the two exclusive options for currency conversion:
Game-Side Conversion
Convert to USD cents on your server for precise control over exchange rates:
Definition KeewanoSDK.cs:18
static void ReportSubscriptionRevenue(string packageName, uint revenueUsdCents)
Reports a subscription revenue event.
Definition KeewanoSDK.cs:441
This gives you full control over exchange rates and ensures consistency with your other analytics tools.
Keewano-Side Conversion
Pass the local currency and let Keewano handle the conversion:
Product product = GetSubscriptionProduct();
product.definition.id,
(float)product.metadata.localizedPrice,
product.metadata.isoCurrencyCode
);
- Note
- Currency codes must follow ISO 4217. Unrecognized codes are treated as USD. USD values are stored as-is without conversion.
- Warning
- For non-USD currencies, different analytics systems use different exchange rate sources and conversion timing. If you use multiple analytics tools, each may report slightly different revenue figures.
When to call:
- When a subscription is initially purchased
- When a subscription renews
- For trial periods, use $0 or the discounted trial price
Step 2: ReportSubscriptionItemsGranted - Track Subscriber Rewards
Use KeewanoSDK.ReportSubscriptionItemsGranted() to log virtual items or currencies granted to active subscribers.
static void ReportSubscriptionItemsGranted(string packageName, Item[] items)
Reports items granted from a subscription.
Definition KeewanoSDK.cs:479
Represents a game item with a unique identifier and a quantity.
Definition KeewanoItems.cs:11
Parameters:
- packageName - The subscription package identifier
- items - Array of items granted (can also use ReadOnlySpan<Item> for zero-copy performance)
When to call:
- When granting items to active subscribers (e.g., daily VIP bonuses)
Common Scenarios
Scenario 1: Initial Subscription Purchase
Player purchases a monthly subscription for $9.99.
void OnSubscriptionPurchased()
{
const string packageName = "vip_monthly";
};
}
Scenario 2: Free Trial Period
Player starts a free 7-day trial, then converts to paid subscription.
void OnTrialStarted()
{
const string packageName = "vip_monthly";
}
void OnSubscriptionRenewed()
{
const string packageName = "vip_monthly";
}
Scenario 3: Subscription Renewal
Subscription renews after 1 month.
void OnSubscriptionRenewed()
{
const string packageName = "vip_monthly";
}
Scenario 4: Daily Subscriber Rewards
Player receives daily rewards while subscription is active.
void OnDailyLogin()
{
if (PlayerHasActiveSubscription("vip_monthly"))
{
const string packageName = "vip_monthly";
};
}
}
Scenario 5: Multiple Item Rewards
Subscription grants multiple items.
void OnWeeklySubscriberBonus()
{
const string packageName = "premium_yearly";
if (PlayerHasActiveSubscription(packageName))
{
};
}
}
Best Practices
Use Consistent Package Names
Use the same package name for both steps:
void ProcessSubscription()
{
const string packageName = "vip_monthly";
}
String Parameter Limits
Package names and item names are limited to 255 characters and will be trimmed if longer. Empty or null strings will skip the event.
See Also