Keewano Unity SDK
Loading...
Searching...
No Matches
Subscription Revenue

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.

KeewanoSDK.ReportSubscriptionRevenue(packageName, revenueInUsdCents);
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.

Keewano.Item[] rewardItems = { new Keewano.Item("VIP_Currency", 100) };
KeewanoSDK.ReportSubscriptionItemsGranted(packageName, rewardItems);
static void ReportSubscriptionItemsGranted(string packageName, Item[] items)
Reports items granted from a subscription.
Definition KeewanoSDK.cs:416
Definition KBatch.cs:6
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";
// Report the billing
KeewanoSDK.ReportSubscriptionRevenue(packageName, 999); // $9.99
// Grant subscriber benefits
Keewano.Item[] welcomeBonus = {
new Keewano.Item("VIP_Currency", 500),
new Keewano.Item("VIP_Badge", 1)
};
KeewanoSDK.ReportSubscriptionItemsGranted(packageName, welcomeBonus);
}

Scenario 2: Free Trial Period

Player starts a free 7-day trial, then converts to paid subscription.

// Trial starts
void OnTrialStarted()
{
const string packageName = "vip_monthly";
// Report $0 for free trial
// Grant trial benefits
Keewano.Item[] trialBenefits = { new Keewano.Item("VIP_Currency", 100) };
KeewanoSDK.ReportSubscriptionItemsGranted(packageName, trialBenefits);
}
// Trial converts to paid after 7 days
void OnSubscriptionRenewed()
{
const string packageName = "vip_monthly";
// Report first paid billing
KeewanoSDK.ReportSubscriptionRevenue(packageName, 999); // $9.99
}

Scenario 3: Subscription Renewal

Subscription renews after 1 month.

void OnSubscriptionRenewed()
{
const string packageName = "vip_monthly";
// Report the renewal billing
KeewanoSDK.ReportSubscriptionRevenue(packageName, 999); // $9.99
}

Scenario 4: Daily Subscriber Rewards

Player receives daily rewards while subscription is active.

void OnDailyLogin()
{
if (PlayerHasActiveSubscription("vip_monthly"))
{
const string packageName = "vip_monthly";
// Grant daily VIP rewards
Keewano.Item[] dailyRewards = {
new Keewano.Item("VIP_Currency", 100),
new Keewano.Item("Daily_Energy", 50)
};
KeewanoSDK.ReportSubscriptionItemsGranted(packageName, dailyRewards);
}
}

Scenario 5: Multiple Item Rewards

Subscription grants multiple items.

void OnWeeklySubscriberBonus()
{
const string packageName = "premium_yearly";
if (PlayerHasActiveSubscription(packageName))
{
Keewano.Item[] weeklyBonus = {
new Keewano.Item("Premium_Coins", 1000),
new Keewano.Item("Exclusive_Lootbox", 1),
new Keewano.Item("Booster_Pack", 3)
};
KeewanoSDK.ReportSubscriptionItemsGranted(packageName, weeklyBonus);
}
}

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";
Keewano.Item[] items = { new Keewano.Item("VIP_Currency", 500) };
KeewanoSDK.ReportSubscriptionItemsGranted(packageName, items); // Same package name
}

Revenue Must Be in USD Cents

Always track revenue in USD cents:

// Free trial
// $0.99 trial
// $9.99 monthly
// $49.99 yearly
KeewanoSDK.ReportSubscriptionRevenue("premium_yearly", 4999);

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