|
Keewano Unity SDK
|

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 | ReportInAppPurchaseItemsGranted (string productName, Item[] items) |
| Reports items granted from an in-app purchase. | |
| static void | ReportInAppPurchaseItemsGranted (string productName, ReadOnlySpan< Keewano.Item > items) |
| Reports items granted from an in-app purchase using read-only spans. | |
| static void | ReportAdRevenue (string placement, uint revenueUsdCents) |
| Reports an ad revenue event. | |
| static void | ReportAdItemsGranted (string placement, Item[] items) |
| Reports items granted from watching an advertisement. | |
| static void | ReportAdItemsGranted (string placement, ReadOnlySpan< Keewano.Item > items) |
| Reports items granted from watching an advertisement using read-only spans. | |
| static void | ReportSubscriptionRevenue (string packageName, uint revenueUsdCents) |
| Reports a subscription revenue event. | |
| static void | ReportSubscriptionItemsGranted (string packageName, Item[] items) |
| Reports items granted from a subscription. | |
| static void | ReportSubscriptionItemsGranted (string packageName, ReadOnlySpan< Keewano.Item > items) |
| Reports items granted from a subscription using read-only spans. | |
| 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. | |
|
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.
|
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.
|
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:
Usage:
|
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.
|
static |
Reports items granted from watching an advertisement.
Use this method to track virtual items or currencies granted to the player after watching an advertisement (e.g., rewarded video ads).
| placement | The ad placement identifier where the ad was shown. |
| items | An array of items granted to the user from watching this ad. |
|
static |
Reports items granted from watching an advertisement using read-only spans.
Use this method to track virtual items or currencies granted to the player after watching an advertisement (e.g., rewarded video ads).
| placement | The ad placement identifier where the ad was shown. |
| items | A read-only span of items granted to the user from watching this ad. |
|
static |
Reports an ad revenue event.
Use this method to log revenue generated from displaying an advertisement by specifying the placement name and the revenue amount in US cents. This event helps track ad monetization activity within the Keewano system for further analysis and reporting.
| placement | The ad placement identifier (e.g., "main_menu_banner", "level_complete_interstitial"). |
| revenueUsdCents | The revenue generated from the ad impression in US cents. |
|
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.
|
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.
|
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.
|
static |
Reports items granted from an in-app purchase.
Use this method to track virtual items or currencies granted to the player after completing an in-app purchase. This is especially useful when items are granted asynchronously or at a different time than the purchase event itself (e.g., server-side validation, delayed grants).
| productName | The product ID as defined in app stores (Apple App Store, Google Play). |
| items | An array of items granted to the user from this purchase. |
|
static |
Reports items granted from an in-app purchase using read-only spans.
Use this method to track virtual items or currencies granted to the player after completing an in-app purchase. This is especially useful when items are granted asynchronously or at a different time than the purchase event itself (e.g., server-side validation, delayed grants).
| productName | The product ID as defined in app stores (Apple App Store, Google Play). |
| items | A read-only span of items granted to the user from this purchase. |
|
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.
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.
| exchangeLocation | The location or context of the item exchange. |
| from | An array of items to be removed from the user's balance (can be null). |
| to | An array of items to be added to the user's balance (can be null). |
|
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.
| exchangeLocation | The location or context of the item exchange. |
| from | A read-only span of items to be removed from the user's balance. |
| to | A read-only span of items to be added to the user's balance. |
|
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.
|
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.
|
static |
Reports items granted from a subscription.
Use this method to track virtual items or currencies granted to the player from an active subscription (e.g., monthly VIP rewards, daily subscription bonuses).
| packageName | The subscription package identifier. |
| items | An array of items granted to the user from this subscription. |
|
static |
Reports items granted from a subscription using read-only spans.
Use this method to track virtual items or currencies granted to the player from an active subscription (e.g., monthly VIP rewards, daily subscription bonuses).
| packageName | The subscription package identifier. |
| items | A read-only span of items granted to the user from this subscription. |
|
static |
Reports a subscription revenue event.
Use this method to log revenue generated from subscription billing (initial purchase, trial conversion, or renewal). This should be called when your app validates the receipt and detects a billing event.
| packageName | The subscription package identifier (e.g., "vip_monthly", "premium_yearly"). |
| revenueUsdCents | The revenue generated from this billing event in US cents. |
|
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.
|
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.
|
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 the "Require Player Consent" option is disabled, the SDK will start collecting and sending data automatically on app launch.
| consentGiven | Pass true if the player has granted consent for data collection, or false if the player has denied consent. |
Usage:
|
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.
Use the UInt64 version for numeric user identifiers or the Guid version if you are using Guids.
|
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.
Use the UInt64 version for numeric user identifiers or the Guid version if you are using Guids.