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 Methods
1. ReportSubscriptionRevenue - Track Subscription Billing
Use KeewanoSDK.ReportSubscriptionRevenue() to log revenue when a subscription starts or renews.
Definition KeewanoSDK.cs:18
static void ReportSubscriptionRevenue(string packageName, uint revenueUsdCents)
Reports a subscription revenue event.
Definition KeewanoSDK.cs:400
Parameters:
- packageName - The subscription package identifier (e.g., "vip_monthly", "premium_yearly")
- revenueUsdCents - The revenue from this billing event in US cents
When to call:
- When a subscription is initially purchased
- When a subscription renews
- For trial periods, use $0 or the discounted trial price
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:416
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 revenue and item grant methods:
void ProcessSubscription()
{
const string packageName = "vip_monthly";
}
Revenue Must Be in USD Cents
Always track revenue in USD cents:
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