Keewano Unity SDK
Loading...
Searching...
No Matches
KeewanoSDK Class Reference

Static Public Member Functions

static void SetUserConsent (bool consentGiven)
 Sets the user's consent for data collection and analytics.
 
static Guid GetInstallId ()
 Retrieves the unique installation ID for the game.
 
static void ReportButtonClick (string buttonName)
 Reports a button click event.
 
static void ReportWindowOpen (string windowName)
 Reports a window/popup open event.
 
static void ReportWindowClose (string windowName)
 Reports a window/popup close event.
 
static void ReportInAppPurchase (string productName, uint priceUsdCents)
 Reports an in-app purchase event.
 
static void ReportInstallCampaign (string campaignName)
 Reports a marketing install campaign for this user.
 
static void ReportGameLanguage (string language)
 Reports the game language.
 
static void ReportOnboardingMilestone (string milestoneName)
 Report that a user has reached a milestone during the onboarding (game tutorial) process.
 
static void ReportABTestGroupAssignment (string testName, char group)
 Marks the user as a participant in an specific test group.
 
static void ReportItemsExchange (string exchangeLocation, Item[] from, Item[] to)
 Reports an item exchange event using item arrays.
 
static void ReportItemsExchange (string exchangeLocation, ReadOnlySpan< Keewano.Item > from, ReadOnlySpan< Keewano.Item > to)
 Reports an item exchange event using read-only spans.
 
static void SetUserId (UInt64 uid)
 Sets the user identifier using a UInt64 value.
 
static void SetUserId (Guid uid)
 Sets the user identifier using a Guid.
 
static void ReportItemsReset (string location, Item[] items)
 Resets the user's items at a specified location.
 
static void MarkAsTestUser (string testerName)
 Marks the device as a test user.
 
static void LogError (string message)
 Reports a technical issue encountered during gameplay.
 

Member Function Documentation

◆ GetInstallId()

static Guid KeewanoSDK.GetInstallId ( )
static

Retrieves the unique installation ID for the game.

KeewanoSDK generates a unique ID for each game installation, enabling anonymous tracking of events from the same installation while ensuring compliance with privacy policies such as GDPR and CCPA.

To associate the installation with your in-game user ID, use the SetUserId method.

See also
SetUserId

◆ LogError()

static void KeewanoSDK.LogError ( string message)
static

Reports a technical issue encountered during gameplay.

Use this method to log any additional or custom errors that may not be captured by the system. This is particularly useful for recording issues unique to your application's behavior. Keewano AI automatically gathers exceptions and Unity error log messages.

◆ MarkAsTestUser()

static void KeewanoSDK.MarkAsTestUser ( string testerName)
static

Marks the device as a test user.

Marking a device as a test user allows Keewano AI to ignore any unusual behavior and bugs reported from it during statistics calculations and investigations. This is especially useful during game testing and integrations.

Use this to:

  1. Isolate Test Data:
    • Use this to keep test events separate from production analytics.
  2. Test SDK Integration:
    • Use this when integrating the KeewanoSDK to verify that event reporting works correctly.
  3. Debug Features:
    • Use this when testing new features or changes in your game.

Usage:

  • Call this API method to explicitly mark and identify test users, enabling clearer validation and debugging during your integration with the game.

◆ ReportABTestGroupAssignment()

static void KeewanoSDK.ReportABTestGroupAssignment ( string testName,
char group )
static

Marks the user as a participant in an specific test group.

A/B testing is a technique used to compare two or more versions of a feature to see which one performs better. In game development, this helps you understand which changes improve gameplay, player satisfaction, or overall balance.

When you assign users to test groups, you can compare how different versions of a feature perform with real players. For example, you might test different reward systems or control schemes by splitting your players into groups, then analyze their behavior and feedback to make data-driven improvements.

◆ ReportButtonClick()

static void KeewanoSDK.ReportButtonClick ( string buttonName)
static

Reports a button click event.

KeewanoSDK automatically collects button click events when using Unity.UI system, capturing the button GameObject names to infer user actions. However, if your game uses a custom UI subsystem or if certain interactive objects—treated as buttons during gameplay but not implemented as standard Unity.UI, use this method to manually report those button clicks.

◆ ReportGameLanguage()

static void KeewanoSDK.ReportGameLanguage ( string language)
static

Reports the game language.

This method logs the game's language setting. While the SDK automatically collects the system language, this method is useful for detecting cases where the game language differs from the system language, which may indicate that the language was manually changed by the user or that the game lacks proper localization.

◆ ReportInAppPurchase()

static void KeewanoSDK.ReportInAppPurchase ( string productName,
uint priceUsdCents )
static

Reports an in-app purchase event.

Use this method to log an in-app purchase by specifying the product name and the price in US cents. This event helps track purchase activity within the Keewano system for further analysis and reporting.

◆ ReportInstallCampaign()

static void KeewanoSDK.ReportInstallCampaign ( string campaignName)
static

Reports a marketing install campaign for this user.

This method logs the marketing campaign that was used to acquire the user into the game. It is used to compare the performance of different marketing sources and their effectiveness in driving user acquisitions.

◆ ReportItemsExchange() [1/2]

static void KeewanoSDK.ReportItemsExchange ( string exchangeLocation,
Item[] from,
Item[] to )
static

Reports an item exchange event using item arrays.

This function notifies the system of an item exchange event occurring at a specified location. The 'from' items represent those deducted from the user's balance, while the 'to' items represent those added. For one-sided transactions, pass null for the corresponding parameter.

Parameters
exchangeLocationThe location or context of the item exchange.
fromAn array of items to be removed from the user's balance (can be null).
toAn array of items to be added to the user's balance (can be null).

◆ ReportItemsExchange() [2/2]

static void KeewanoSDK.ReportItemsExchange ( string exchangeLocation,
ReadOnlySpan< Keewano.Item > from,
ReadOnlySpan< Keewano.Item > to )
static

Reports an item exchange event using read-only spans.

This function notifies the system of an item exchange event occurring at a specified location. The 'from' items represent those deducted from the user's balance, while the 'to' items represent those added. For one-sided transactions, pass an empty span for the corresponding parameter.

Parameters
exchangeLocationThe location or context of the item exchange.
fromA read-only span of items to be removed from the user's balance.
toA read-only span of items to be added to the user's balance.

◆ ReportItemsReset()

static void KeewanoSDK.ReportItemsReset ( string location,
Item[] items )
static

Resets the user's items at a specified location.

This function notifies the system to reset the user's items at the given location, typically used to initialize or correct the user's item balance.

◆ ReportOnboardingMilestone()

static void KeewanoSDK.ReportOnboardingMilestone ( string milestoneName)
static

Report that a user has reached a milestone during the onboarding (game tutorial) process.

The data reported using this method will be used to automatically generate an FTUE (first-time user experience) funnel for your players and will be used by our AI to investigate the behavior of users who are churning during the onboarding process.

Note
Each milestone should have a unique name and must not be reported more than once during onboarding. This ensures that analytics accurately reflect the user's progress, while still allowing flexibility.

◆ ReportWindowClose()

static void KeewanoSDK.ReportWindowClose ( string windowName)
static

Reports a window/popup close event.

This method is used to capture the event when a window or popup is closed, helping to understand the context and scope of the user's actions.

◆ ReportWindowOpen()

static void KeewanoSDK.ReportWindowOpen ( string windowName)
static

Reports a window/popup open event.

This method is used to capture the event when a window or popup is opened, helping to understand the context and scope of the user's actions.

◆ SetUserConsent()

static void KeewanoSDK.SetUserConsent ( bool consentGiven)
static

Sets the user's consent for data collection and analytics.

This method is used to inform the KeewanoSDK whether the player has granted or denied consent for data collection, in compliance with privacy regulations such as GDPR and CCPA.

If the "Require Player Consent" option is enabled, the SDK will buffer analytics data locally until you call this method:

  • If you call SetUserConsent(true), all buffered data will be sent to the server, and the SDK will continue to collect and send analytics data from that point onward.
  • If you call SetUserConsent(false), all buffered data will be discarded and no further data will be collected or sent.

If the "Require Player Consent" option is disabled, the SDK will start collecting and sending data automatically on app launch.

Parameters
consentGivenPass true if the player has granted consent for data collection, or false if the player has denied consent.

Usage:

  • Show your own consent dialog to the player at app launch or at an appropriate time.
  • Call KeewanoSDK.SetUserConsent(true) or KeewanoSDK.SetUserConsent(false) based on the player's choice.
See also
Please refer to Data Privacy for more information on the topic.

◆ SetUserId() [1/2]

static void KeewanoSDK.SetUserId ( Guid uid)
static

Sets the user identifier using a Guid.

The method is for setting the user identifier, which is used to correlate a player's behavior in the Keewano system with the corresponding user in the game systems.

Note
The user identifier should only be assigned once per game installation and cannot be reassigned.

Use the UInt64 version for numeric user identifiers or the Guid version if you are using Guids.

◆ SetUserId() [2/2]

static void KeewanoSDK.SetUserId ( UInt64 uid)
static

Sets the user identifier using a UInt64 value.

The method is for setting the user identifier, which is used to correlate a player's behavior in the Keewano system with the corresponding user in the game systems.

Note
The user identifier should only be assigned once per game installation and cannot be reassigned.

Use the UInt64 version for numeric user identifiers or the Guid version if you are using Guids.


The documentation for this class was generated from the following file: