Keewano Unity SDK
Loading...
Searching...
No Matches
Integrating SDK into Existing Games

Overview

When integrating the Keewano SDK into a game that already has an established player base, you need to tell Keewano about your existing users so they are correctly identified by their actual tenure in your game.

Simple Integration

Keewano makes integration into existing games simple. You don't need to export databases, migrate historical logs, or set up complex data pipelines. Just provide one piece of information for your existing players: when they originally registered.

With this single data point, Keewano can:

  • Place players in the correct day-in-game cohort (Day 1, Day 30, Day 365, etc.)
  • Accurately calculate retention metrics
  • Compare behavior patterns between new and veteran players
  • Generate meaningful insights about player lifecycle stages

Everything else - player behavior, progression patterns, monetization habits - is captured automatically by the SDK from integration day forward.

The Method

Use KeewanoSDK.ReportUserRegisteredBeforeSDKIntegration() to report the original registration date for users who existed before the SDK was integrated.

static public void ReportUserRegisteredBeforeSDKIntegration(DateTime originalRegistrationTime)

When to Use This Method

Call this method only for users who:

  • Already had an account in your game before the Keewano SDK was integrated
  • Have a known registration date in your existing player database

Do NOT call this method for:

  • New users who register after SDK integration (they are tracked automatically)
  • Users whose original registration date is unknown

Usage

Recommended Integration Flow

// The date when Keewano SDK was integrated into your game
public static readonly DateTime SDKIntegrationDate = new DateTime(2025, 2, 1);
void OnUserAuthenticated(UserData user)
{
// Check if this user existed before SDK integration
if (user.RegistrationDate < SDKIntegrationDate)
{
// This user existed before SDK integration - report their original registration date
}
// For users who registered after SDK integration, do nothing -
// the SDK tracks them automatically
}
Definition KeewanoSDK.cs:18
static void ReportUserRegisteredBeforeSDKIntegration(DateTime originalRegistrationTime)
Reports the original registration date for users who existed before SDK integration.
Definition KeewanoSDK.cs:234

Simple Example

// User registered on March 15, 2022 - before you added the SDK
DateTime originalRegistration = new DateTime(2022, 3, 15);

Method Behavior

Once Per Installation

This method can only be called once per installation. Subsequent calls are silently ignored.

// First call - accepted
// Second call - silently ignored

Date Validation

The method validates that the provided date is in the past. Future dates are rejected:

// Valid - date in the past
// Invalid - future date, call is ignored
KeewanoSDK.ReportUserRegisteredBeforeSDKIntegration(DateTime.Now.AddDays(1)); // No effect

In the Unity Editor, a warning is logged when invalid dates are provided.

Best Practices

Call Early

Call this method as early as possible after user authentication:

void Start()
{
AuthenticateUser();
}
void OnAuthenticationComplete(UserData user)
{
if (user.RegistrationDate < SDKIntegrationDate)
{
}
LoadMainMenu();
}

Use Server-Side Data

Always use the registration date from your server, not from client-side cache:

void OnServerAuthResponse(AuthResponse response)
{
DateTime registrationDate = response.User.RegistrationDateUtc;
}

Common Mistakes

Don't Call for New Users

This method is only for users who existed before SDK integration:

// WRONG
void OnNewUserRegistered(UserData newUser)
{
KeewanoSDK.ReportUserRegisteredBeforeSDKIntegration(DateTime.Now); // Don't do this!
}
// CORRECT
void OnUserAuthenticated(UserData user)
{
if (user.RegistrationDate < SDKIntegrationDate)
{
}
}