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 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:

    // Pass revenue in USD cents
    KeewanoSDK.ReportSubscriptionRevenue(packageName, revenueInUsdCents);
    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:

    // Pass revenue in local currency
    Product product = GetSubscriptionProduct();
    product.definition.id,
    (float)product.metadata.localizedPrice, // e.g., 9.99f for €9.99
    product.metadata.isoCurrencyCode // e.g., "EUR" or "USD"
    );
    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.

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:479
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 steps:

void ProcessSubscription()
{
const string packageName = "vip_monthly";
Keewano.Item[] items = { new Keewano.Item("VIP_Currency", 500) };
KeewanoSDK.ReportSubscriptionItemsGranted(packageName, items); // Same package name
}

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