Kongregate Mobile Unity API
Public Member Functions | List of all members
Kongregate.IAnalytics Interface Reference

This interface wraps the functionality provided by the Adjust and Swrve SDKs. More...

Public Member Functions

void LoadKongregateJavascriptAPI ()
 Loads the Kongregate Javascript API Internal method for WebGL to function.
 
void InitAutomaticProperties ()
 Update the automatic properties in JS API Internal method for WebGL to function.
 
void SetCommonPropsCallback (delegateGetCommonProperties callback)
 Set the common properties callback. More...
 
void SetCommonProperties (string jsonString)
 Sets the common properties from a string representation of a JSON object.
 
void SetCommonProperties (Dictionary< string, object > props)
 Sets the common properties from a dictionary. More...
 
void UpdateCommonProps ()
 Manually run the common properties delegate to update the properties. More...
 
void GameUserUpdate (Dictionary< string, object > props)
 Update Game User Properties. More...
 
void GameUserUpdate (string propsJson)
 Update Game User Properties. More...
 
void AddEvent (string collection, Dictionary< string, object > evt)
 Add the event to Analytics. More...
 
void AddEvent (string collection, string jsonMap)
 Add event to Analytics using a JSON String.
 
void SetSwrveButtonListener (string gameObjectName, string functionName)
 Sets the callback listener for Swrve in-app messages (http://docs.swrve.com/user-documentation/in-app-messaging/). More...
 
void SetDeltaButtonListener (Analytics.ButtonActionListener listener)
 Sets the callback listener for Delta in-app messages Will be invoked when a deep link is selected as the message Action. More...
 
void SetDeltaParameterListener (Analytics.ParameterListener listener)
 Sets the callback listener for Delta event recording. More...
 
void SetAutoEventListener (GameObject gameObject, KongregateAPI.EventDelegate listener)
 Sets a listener for analytic events the Kongregate SDK automatically fires. More...
 
void SetPushToken (string token)
 Notifies adjust the device token for iOS and firebase push token for Android. More...
 
void SetFilterType (string filterType)
 Deprecated. More...
 
void AddFilterType (string filterType)
 Adds a filter type to the filter list. More...
 
void TrackPurchase (string productID, int quantity)
 Deprecated. More...
 
string GetInstallReferrer ()
 Get the install referrer on Android, if set. More...
 
string GetAutoPropertiesJSON ()
 Get a JSON string for all automatic properties. More...
 
long GetAutoLongProperty (string field)
 Get a long automatic property. More...
 
string GetAutoStringProperty (string field)
 Get a string automatic property. More...
 
bool GetAutoBoolProperty (string field)
 Get a boolean automatic property. More...
 
double GetAutoDoubleProperty (string field)
 Get a double automatic property. More...
 
int GetAutoIntProperty (string field)
 Get an integer automatic property. More...
 
string GetAutoUTCProperty (string field)
 Get a UTC timestamp string automatic property. More...
 
void StartPurchase (string productID, int quantity, Dictionary< string, object > gameFields)
 Creates an Adjust/Swrve iap_attemps event. More...
 
void StartPurchase (string productID, int quantity, string gameFieldsJson)
 Creates an Adjust/Swrve iap_attemps event. More...
 
void FinishPurchase (string resultCode, string transactionId, Dictionary< string, object > gameFields)
 Finish a purchase that was started with StartPurchase(). More...
 
void FinishPurchase (string resultCode, string transactionId, string gameFieldsJson)
 Finish a purchase that was started with StartPurchase(). More...
 
void FinishPurchaseWithProductId (string resultCode, string productID, string receipt, string gameFieldsJson)
 iOS Only. More...
 
void FinishPurchaseWithProductId (string resultCode, string productID, string receipt, Dictionary< string, object > gameFields)
 iOS Only Finish a purchase that was started with StartPurchase(). More...
 
void FinishPurchase (string resultCode, string transactionId, Dictionary< string, object > gameFields, string dataSignature)
 Finish a purchase that was started with StartPurchase(). More...
 
void FinishPurchase (string resultCode, string transactionId, string gameFieldsJson, string dataSignature)
 Finish a purchase that was started with StartPurchase(). More...
 
void AddGoogleIapTransaction (double revenueUSD, string receiptOriginalJSON, string receiptSignature, string gameFieldsJson)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase. More...
 
void AddGoogleIapTransaction (double revenueUSD, string receiptOriginalJSON, string receiptSignature, Dictionary< string, object > gameFields)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase. More...
 
void AddGoogleIapTransactionWithCurrency (double revenue, string currency, string receiptOriginalJSON, string receiptSignature, string gameFieldsJson)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase. More...
 
void AddGoogleIapTransactionWithCurrency (double revenue, string currency, string receiptOriginalJSON, string receiptSignature, Dictionary< string, object > gameFields)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase. More...
 
void AddIOSIapTransaction (double revenueUSD, string transactionId, string gameFieldsJson)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase. More...
 
void AddIOSIapTransaction (double revenue, string transactionId, Dictionary< string, object > gameFields)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase. More...
 
void AddIOSIapTransactionWithCurrency (double revenue, string currency, string transactionId, string gameFieldsJson)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase. More...
 
void AddIOSIapTransactionWithCurrency (double revenue, string currency, string transactionId, Dictionary< string, object > gameFields)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase. More...
 
void AddSimpleIapTransaction (double revenue, string currency, string productId, string gameFieldsJson)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS or Google Purchase. More...
 
void AddSimpleIapTransaction (double revenue, string currency, string productId, Dictionary< string, object > gameFields)
 Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS or Google Purchase. More...
 
string GetResourceNames ()
 Retrieve the set of Swrve resource names. More...
 
string GetResourceAsString (string resourceId, string attributeId, string defValue)
 Retrieve a Swrve A/B test resource as a string. More...
 
int GetResourceAsInt (string resourceId, string attributeId, int defValue)
 Retrieve a Swrve A/B test resource as an int. More...
 
float GetResourceAsFloat (string resourceId, string attributeId, float defValue)
 Retrieve a Swrve A/B test resource as a float. More...
 
bool GetResourceAsBool (string resourceId, string attributeId, bool defValue)
 Retrieve a Swrve A/B test resource as a bool. More...
 
void FinishPromoAward (string promoId)
 Notify the SDK that the promo with the associated ID has been awarded. More...
 
void TrackPurchase (string productID, int quantity, Dictionary< string, object > fields)
 Deprecated. More...
 
void Start ()
 When using KongregateSettings.DeferAnalytics, this allows you to start the analytics subsystem. More...
 
void StartDeltaDNA ()
 Internal method to start Unity DeltaDNA analytics separately. More...
 

Detailed Description

This interface wraps the functionality provided by the Adjust and Swrve SDKs.

It also includeds legacy support for Keen. Ad-X has been removed from the Kongregate SDK.

The primary purpose of this interface is to expose hooks for games to pass events to Swrve and Adjust. It also provides wrappers for some additional Swrve features such as User Properties, A/B Testing, and Push Notifications. See the Mobile SDK Docs for details of the various features.

Member Function Documentation

◆ AddEvent()

void Kongregate.IAnalytics.AddEvent ( string  collection,
Dictionary< string, object >  evt 
)

Add the event to Analytics.

The key must be less than 256 characters, not start with '$' or contain '.'

The Dictionary<string,object> may include a list of keys mapped to Number, String, Array, or Boolean. Other values types will not be submitted as events.

◆ AddFilterType()

void Kongregate.IAnalytics.AddFilterType ( string  filterType)

Adds a filter type to the filter list.

Parameters
filterTypethe filter to add

◆ AddGoogleIapTransaction() [1/2]

void Kongregate.IAnalytics.AddGoogleIapTransaction ( double  revenueUSD,
string  receiptOriginalJSON,
string  receiptSignature,
string  gameFieldsJson 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase.

SEE: KongAnalyticsOnlyDemo.cs for example usage

This is the preferred method to use when the purchased product does not conform to the TXX_description naming convention. It is preferred because the revenue is explicitly provided in USD where we are unable to infer the USD cost from the ID. By including the original receipt and signature we can extract additional information about the purchase and validate the receipt.

This should be invoked after the purchase is complete and the receipt verified.

Parameters
revenueUSDthe purchase price of the item in US Dollars
receiptOrigialJSONthe original JSON receipt returned by the Google Play Store
receiptSignaturethe signature returned by the Google Play Store
gameFieldsJsonJSON formated object of additional fields to include with the event (e.g. soft_currency_change )

◆ AddGoogleIapTransaction() [2/2]

void Kongregate.IAnalytics.AddGoogleIapTransaction ( double  revenueUSD,
string  receiptOriginalJSON,
string  receiptSignature,
Dictionary< string, object >  gameFields 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase.

SEE: KongAnalyticsOnlyDemo.cs for example usage

This is the preferred method to use when the purchased product does not conform to the TXX_description naming convention. It is preferred because the revenue is explicitly provided in USD where we are unable to infer the USD cost from the ID. By including the original receipt and signature we can extract additional information about the purchase and validate the receipt.

This should be invoked after the purchase is complete and the receipt verified.

Parameters
revenueUSDthe purchase price of the item in US Dollars
receiptOrigialJSONthe original JSON receipt returned by the Google Play Store
receiptSignaturethe signature returned by the Google Play Store
gameFieldsDictionary of additional fields to include with the event (e.g. soft_currency_change )

◆ AddGoogleIapTransactionWithCurrency() [1/2]

void Kongregate.IAnalytics.AddGoogleIapTransactionWithCurrency ( double  revenue,
string  currency,
string  receiptOriginalJSON,
string  receiptSignature,
string  gameFieldsJson 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase.

AddGoogleIapTransaction() is the preferred method to use since it allows revenue to be normalized to USD. This method may be used when the USD price is unknown. Adjust does convert the revenue to USD in it's sale event, however Kongregate Analytics will not.

This should be invoked after the purchase is complete and the receipt verified.

Parameters
revenuethe purchase price of the item in the given currency
currencythe currency code the revenue is reported in.
receiptOrigialJSONthe original JSON receipt returned by the Google Play Store
receiptSignaturethe signature returned by the Google Play Store
gameFieldsJsonJSON formated object of additional fields to include with the event (e.g. soft_currency_change )

◆ AddGoogleIapTransactionWithCurrency() [2/2]

void Kongregate.IAnalytics.AddGoogleIapTransactionWithCurrency ( double  revenue,
string  currency,
string  receiptOriginalJSON,
string  receiptSignature,
Dictionary< string, object >  gameFields 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for a Google Purchase.

AddGoogleIapTransaction() is the preferred method to use since it allows revenue to be normalized to USD. This method may be used when the USD price is unknown. Adjust does convert the revenue to USD in it's sale event, however Kongregate Analytics will not.

This should be invoked after the purchase is complete and the receipt verified.

Parameters
revenuethe purchase price of the item in the given currency
currencythe currency code the revenue is reported in.
receiptOrigialJSONthe original JSON receipt returned by the Google Play Store
receiptSignaturethe signature returned by the Google Play Store
gameFieldsDictionary of additional fields to include with the event (e.g. soft_currency_change )

◆ AddIOSIapTransaction() [1/2]

void Kongregate.IAnalytics.AddIOSIapTransaction ( double  revenueUSD,
string  transactionId,
string  gameFieldsJson 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase.

SEE: KongAnalyticsOnlyDemo.cs for example usage

This is the preferred method to use when the purchased product does not conform to the TXX_description naming convention. It is preferred because the revenue is explicitly provided in USD where we are unable to infer the USD cost from the ID. By including the iOS transaction ID we can extract additional information about the purchase.

This should be invoked after the purchase is complete and the receipt verified but before the transaction is consumed. Once a transaction is consumed the SDK can no longer extract information from the payment queue.

Parameters
revenueUSDthe purchase price of the item in US Dollars
transactionIdthe iOS transaction ID for the purchase
gameFieldsJsonJSON formated object of additional fields to include with the event (e.g. soft_currency_change)

◆ AddIOSIapTransaction() [2/2]

void Kongregate.IAnalytics.AddIOSIapTransaction ( double  revenue,
string  transactionId,
Dictionary< string, object >  gameFields 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase.

SEE: KongAnalyticsOnlyDemo.cs for example usage

This is the preferred method to use when the purchased product does not conform to the TXX_description naming convention. It is preferred because the revenue is explicitly provided in USD where we are unable to infer the USD cost from the ID. By including the iOS transaction ID we can extract additional information about the purchase.

This should be invoked after the purchase is complete and the receipt verified but before the transaction is consumed. Once a transaction is consumed the SDK can no longer extract information from the payment queue.

Parameters
revenueUSDthe purchase price of the item in US Dollars
transactionIdthe iOS transaction ID for the purchase
gameFieldsDictionary of additional fields to include with the event (e.g. soft_currency_change)

◆ AddIOSIapTransactionWithCurrency() [1/2]

void Kongregate.IAnalytics.AddIOSIapTransactionWithCurrency ( double  revenue,
string  currency,
string  transactionId,
string  gameFieldsJson 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase.

AddIOSIapTransaction() is the preferred method to use since it allows revenue to be normalized to USD. However, this method may be used when the USD price is unknown. Adjust does convert the revenue to USD, however Kongregate Analytics will not.

This should be invoked after the purchase is complete and the receipt verified but before the transaction is consumed. Once a transaction is consumed the SDK can no longer extract information from the payment queue.

Parameters
revenuethe purchase price of the item in the given currency
currencythe currency code the revenue is reported in.
transactionIdthe iOS transaction ID for the purchase
gameFieldsJsonJSON formated object of additional fields to include with the event (e.g. soft_currency_change)

◆ AddIOSIapTransactionWithCurrency() [2/2]

void Kongregate.IAnalytics.AddIOSIapTransactionWithCurrency ( double  revenue,
string  currency,
string  transactionId,
Dictionary< string, object >  gameFields 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS Purchase.

AddIOSIapTransaction() is the preferred method to use since it allows revenue to be normalized to USD. However, this method may be used when the USD price is unknown. Adjust does convert the revenue to USD, however Kongregate Analytics will not.

This should be invoked after the purchase is complete and the receipt verified but before the transaction is consumed. Once a transaction is consumed the SDK can no longer extract information from the payment queue.

Parameters
revenuethe purchase price of the item in the given currency
currencythe currency code the revenue is reported in.
transactionIdthe iOS transaction ID for the purchase
gameFieldsDictionary of additional fields to include with the event (e.g. soft_currency_change )

◆ AddSimpleIapTransaction() [1/2]

void Kongregate.IAnalytics.AddSimpleIapTransaction ( double  revenue,
string  currency,
string  productId,
string  gameFieldsJson 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS or Google Purchase.

AddIOSIapTransaction() and AddGoogleIapTransaction() are the preferred methods. This one may be used when the Google receipt or iOS transaction is not available.

This should be invoked of the purchase is complete and the receipt has been verified.

Parameters
revenuethe purchase price of the item in the given currency
currencythe currency code the revenue is reported in.
productIdthe identifier for the purchased product
gameFieldsJsonJSON formated object of additional fields to include with the event (e.g. soft_currency_change)

◆ AddSimpleIapTransaction() [2/2]

void Kongregate.IAnalytics.AddSimpleIapTransaction ( double  revenue,
string  currency,
string  productId,
Dictionary< string, object >  gameFields 
)

Add a Kongregate Analytics iap_transaction event and Adjust sale event for an iOS or Google Purchase.

AddIOSIapTransaction() and AddGoogleIapTransaction() are the preferred methods. This one may be used when the Google receipt or iOS transaction is not available.

Parameters
revenuethe purchase price of the item in the given currency
currencythe currency code the revenue is reported in.
productIdthe identifier for the purchased product
gameFieldsDictionary of additional fields to include with the event (e.g. soft_currency_change)

◆ FinishPromoAward()

void Kongregate.IAnalytics.FinishPromoAward ( string  promoId)

Notify the SDK that the promo with the associated ID has been awarded.

This will update a Swrve User Property that will prevent the SDK from sending another in-app message for the Award.

It's a good idea, particularly if your game has a server component, to also track awarded promoIds and to display a message if your game is asked to award a promo that has already been awarded. This will handle an edge case where a user can trick the client into showing the in-app message to perform the award again.

Parameters
promoIdthe promoId associated with the award

◆ FinishPurchase() [1/4]

void Kongregate.IAnalytics.FinishPurchase ( string  resultCode,
string  transactionId,
Dictionary< string, object >  gameFields 
)

Finish a purchase that was started with StartPurchase().

The method will create either iap_transactions or iap_fails purchase events depending on resultCode and state of the resultData. Will also fire Adjust and Swrve IAP events upon success.

Invoke this after the purchase is complete and the receipt verified (if using Receipt Verification). For iOS be sure to invoke before [SKPaymentQueue finishTransaction:], as the transactionId must still exist in the SKPaymentQueue to extract the required information.

Parameters
resultCodeone of SUCCESS, FAIL, RECEIPT_FAIL
transactionIdvalue of this parameter is different for iOS and Android.
  • For iOS: the StoreKit transaction ID, if known. The transactionId must be included if the resultCode is SUCCESS or RECEIPT_FAIL. For the FAIL case, some plug-ins do not include the transactionId in the callback. For this case, pass nil and the SDK will attempt to the failed transaction in the StoreKit payment queue.
  • For Android: on SUCCESS or RECEIPT_FAIL this should be the orginalJson returned from the playstore. If using IABHelper classes: Purchase.getOriginalJson()). If the result is fail, pass the error message from the result. Again if ussing IABHelper classes: IabResult.getMessage().
gameFieldsdictionary values to pass along with the event (e.g. hard_currency_changed, soft_currency_changed, etc.)

◆ FinishPurchase() [2/4]

void Kongregate.IAnalytics.FinishPurchase ( string  resultCode,
string  transactionId,
string  gameFieldsJson 
)

Finish a purchase that was started with StartPurchase().

The method will create either iap_transactions or iap_fails purchase events depending on resultCode and state of the resultData. Will also fire Adjust and Swrve IAP events upon success.

Invoke this after the purchase is complete and the receipt verified (if using Receipt Verification). For iOS be sure to invoke before [SKPaymentQueue finishTransaction:], as the transactionId must still exist in the SKPaymentQueue to extract the required information.

Parameters
resultCodeone of SUCCESS, FAIL, RECEIPT_FAIL
transactionIdvalue of this parameter is different for iOS and Android.
  • For iOS: the StoreKit transaction ID, if known. The transactionId must be included if the resultCode is SUCCESS or RECEIPT_FAIL. For the FAIL case, some plug-ins do not include the transactionId in the callback. For this case, pass nil and the SDK will attempt to the failed transaction in the StoreKit payment queue.
  • For Android: on SUCCESS or RECEIPT_FAIL this should be the orginalJson returned from the playstore. If using IABHelper classes: Purchase.getOriginalJson()). If the result is fail, pass the error message from the result. Again if ussing IABHelper classes: IabResult.getMessage().
gameFieldsJsonjson string with values to pass along with the event (e.g. hard_currency_changed, soft_currency_changed, etc.)

◆ FinishPurchase() [3/4]

void Kongregate.IAnalytics.FinishPurchase ( string  resultCode,
string  transactionId,
Dictionary< string, object >  gameFields,
string  dataSignature 
)

Finish a purchase that was started with StartPurchase().

The method will create either iap_transactions or iap_fails purchase events depending on resultCode and state of the resultData. Will also fire Adjust nd Swrve IAP events upon success.

Invoke this after the purchase is complete and the receipt verified (if using Receipt Verification). For iOS be sure to invoke before [SKPaymentQueue finishTransaction:], as the transactionId must still exist in the SKPaymentQueue to extract the required information.

Parameters
resultCodeone of SUCCESS, FAIL, RECEIPT_FAIL
transactionIdvalue of this parameter is different for iOS and Android.
  • For iOS: the StoreKit transaction ID, if known. The transactionId must be included if the resultCode is SUCCESS or RECEIPT_FAIL. For the FAIL case, some plug-ins do not include the transactionId in the callback. For this case, pass nil and the SDK will attempt to the failed transaction in the StoreKit payment queue.
  • For Android: on SUCCESS or RECEIPT_FAIL this should be the orginalJson returned from the playstore. If using IABHelper classes: Purchase.getOriginalJson()). If the result is fail, pass the error message from the result. Again if ussing IABHelper classes: IabResult.getMessage().
gameFieldsdictionary values to pass along with the event (e.g. hard_currency_changed, soft_currency_changed, etc.)
dataSignaturethe signature used to sign result data. Used by SWRVE analytics to verify the purchase (Android Only). Ignored on iOS. If nil on Android, Swrve will no validate the receipt.

◆ FinishPurchase() [4/4]

void Kongregate.IAnalytics.FinishPurchase ( string  resultCode,
string  transactionId,
string  gameFieldsJson,
string  dataSignature 
)

Finish a purchase that was started with StartPurchase().

The method will create either iap_transactions or iap_fails purchase events depending on resultCode and state of the resultData. Will also fire Adjust and Swrve IAP events upon success.

Invoke this after the purchase is complete and the receipt verified (if using Receipt Verification). For iOS be sure to invoke before [SKPaymentQueue finishTransaction:], as the transactionId must still exist in the SKPaymentQueue to extract the required information.

Parameters
resultCodeone of SUCCESS, FAIL, RECEIPT_FAIL
transactionIdvalue of this parameter is different for iOS and Android.
  • For iOS: the StoreKit transaction ID, if known. The transactionId must be included if the resultCode is SUCCESS or RECEIPT_FAIL. For the FAIL case, some plug-ins do not include the transactionId in the callback. For this case, pass nil and the SDK will attempt to the failed transaction in the StoreKit payment queue.
  • For Android: on SUCCESS or RECEIPT_FAIL this should be the orginalJson returned from the playstore. If using IABHelper classes: Purchase.getOriginalJson()). If the result is fail, pass the error message from the result. Again if ussing IABHelper classes: IabResult.getMessage().
gameFieldsJsonjson string with values to pass along with the event (e.g. hard_currency_changed, soft_currency_changed, etc.)
dataSignaturethe signature used to sign result data. Used by SWRVE analytics to verify the purchase (Android Only). Ignored on iOS. If nil on Android, Swrve will no validate the receipt.

◆ FinishPurchaseWithProductId() [1/2]

void Kongregate.IAnalytics.FinishPurchaseWithProductId ( string  resultCode,
string  productID,
string  receipt,
string  gameFieldsJson 
)

iOS Only.

Finish a purchase that was started with StartPurchase(). Will result in either an iap_fails or iap_transactions event. Use this version for iOS only, if you have a Product ID and receipt, but not the transaction ID. The other FinishPurchase() methods are preferrable, because transaction information may be pulled directly from the transaction.

Parameters
resultCodeone of PURCHASE_FAIL, PURCHASE_SUCCESS, PURCHASE_RECEIPT_FAIL
productIDthe product of the item purchased.
receiptthe receipt data base64 encoded
gameFieldsJsonjson string of fields to send up with the event.

◆ FinishPurchaseWithProductId() [2/2]

void Kongregate.IAnalytics.FinishPurchaseWithProductId ( string  resultCode,
string  productID,
string  receipt,
Dictionary< string, object >  gameFields 
)

iOS Only Finish a purchase that was started with StartPurchase().

Will result in either an iap_fails or iap_transactions event. Use this version for iOS only, if you have a Product ID and receipt, but not the transaction ID. The other FinishPurchase() methods are preferrable, because transaction information may be pulled directly from the transaction.

Parameters
resultCodeone of PURCHASE_FAIL, PURCHASE_SUCCESS, PURCHASE_RECEIPT_FAIL
productIDthe product of the item purchased.
receiptthe receipt data base64 encoded
gameFieldsdictionary game fields to send up with the event.

◆ GameUserUpdate() [1/2]

void Kongregate.IAnalytics.GameUserUpdate ( Dictionary< string, object >  props)

Update Game User Properties.

If Swrve is enabled, these will be passed to the Swrve SDK. All values must be strings.

◆ GameUserUpdate() [2/2]

void Kongregate.IAnalytics.GameUserUpdate ( string  propsJson)

Update Game User Properties.

Values must be Strings. If Swrve is enabled, these will be passed to the Swrve SDK.

◆ GetAutoBoolProperty()

bool Kongregate.IAnalytics.GetAutoBoolProperty ( string  field)

Get a boolean automatic property.

Parameters
fieldThe field name
Returns
The prop value

◆ GetAutoDoubleProperty()

double Kongregate.IAnalytics.GetAutoDoubleProperty ( string  field)

Get a double automatic property.

Parameters
fieldThe field name
Returns
The prop value

◆ GetAutoIntProperty()

int Kongregate.IAnalytics.GetAutoIntProperty ( string  field)

Get an integer automatic property.

Parameters
fieldThe field name
Returns
The prop value

◆ GetAutoLongProperty()

long Kongregate.IAnalytics.GetAutoLongProperty ( string  field)

Get a long automatic property.

Parameters
fieldThe field name
Returns
The prop value

◆ GetAutoPropertiesJSON()

string Kongregate.IAnalytics.GetAutoPropertiesJSON ( )

Get a JSON string for all automatic properties.

Returns
a JSON formatted string of all automatic properties, or an empty string on error

◆ GetAutoStringProperty()

string Kongregate.IAnalytics.GetAutoStringProperty ( string  field)

Get a string automatic property.

Parameters
fieldThe field name
Returns
The prop value

◆ GetAutoUTCProperty()

string Kongregate.IAnalytics.GetAutoUTCProperty ( string  field)

Get a UTC timestamp string automatic property.

Parameters
fieldThe field name
Returns
The prop value

◆ GetInstallReferrer()

string Kongregate.IAnalytics.GetInstallReferrer ( )

Get the install referrer on Android, if set.

Otherwise, returns an empty string.

◆ GetResourceAsBool()

bool Kongregate.IAnalytics.GetResourceAsBool ( string  resourceId,
string  attributeId,
bool  defValue 
)

Retrieve a Swrve A/B test resource as a bool.

Parameters
resourceIdthe ID of the Swrve resource
attributeIdthe ID of the attribute
defValuea devault value if the resource/attribute is not found.
Returns
the value of the attribute in the resource, or the default alue if not found.

◆ GetResourceAsFloat()

float Kongregate.IAnalytics.GetResourceAsFloat ( string  resourceId,
string  attributeId,
float  defValue 
)

Retrieve a Swrve A/B test resource as a float.

Parameters
resourceIdthe ID of the Swrve resource
attributeIdthe ID of the attribute
defValuea devault value if the resource/attribute is not found.
Returns
the value of the attribute in the resource, or the default alue if not found.

◆ GetResourceAsInt()

int Kongregate.IAnalytics.GetResourceAsInt ( string  resourceId,
string  attributeId,
int  defValue 
)

Retrieve a Swrve A/B test resource as an int.

Parameters
resourceIdthe ID of the Swrve resource
attributeIdthe ID of the attribute
defValuea devault value if the resource/attribute is not found.
Returns
the value of the attribute in the resource, or the default alue if not found.

◆ GetResourceAsString()

string Kongregate.IAnalytics.GetResourceAsString ( string  resourceId,
string  attributeId,
string  defValue 
)

Retrieve a Swrve A/B test resource as a string.

Parameters
resourceIdthe ID of the Swrve resource
attributeIdthe ID of the attribute
defValuea devault value if the resource/attribute is not found.
Returns
the value of the attribute in the resource, or the default alue if not found.

◆ GetResourceNames()

string Kongregate.IAnalytics.GetResourceNames ( )

Retrieve the set of Swrve resource names.

Returns
the resource names as a JSON array.

◆ SetAutoEventListener()

void Kongregate.IAnalytics.SetAutoEventListener ( GameObject  gameObject,
KongregateAPI.EventDelegate  listener 
)

Sets a listener for analytic events the Kongregate SDK automatically fires.

Most games will not need to listen for these events. It's useful if you wish to echo the events to your own analytics collection system.

Parameters
gameObjectAn active GameObject
listenerthe delegate to be notified of the events.

◆ SetCommonProperties()

void Kongregate.IAnalytics.SetCommonProperties ( Dictionary< string, object >  props)

Sets the common properties from a dictionary.

The allowed types for the dictionary are the same as AddEvent.

◆ SetCommonPropsCallback()

void Kongregate.IAnalytics.SetCommonPropsCallback ( delegateGetCommonProperties  callback)

Set the common properties callback.

If set, this method is invoked when events are added.

Parameters
callbackThe delegate to be called to collect common properties

◆ SetDeltaButtonListener()

void Kongregate.IAnalytics.SetDeltaButtonListener ( Analytics.ButtonActionListener  listener)

Sets the callback listener for Delta in-app messages Will be invoked when a deep link is selected as the message Action.

Parameters
gameObjectNamethe game object to handle the action
functionNamethe function on the game object that will be invoked

◆ SetDeltaParameterListener()

void Kongregate.IAnalytics.SetDeltaParameterListener ( Analytics.ParameterListener  listener)

Sets the callback listener for Delta event recording.

Parameters
gameObjectNamethe game object to handle the action
functionNamethe function on the game object that will be invoked

◆ SetFilterType()

void Kongregate.IAnalytics.SetFilterType ( string  filterType)

◆ SetPushToken()

void Kongregate.IAnalytics.SetPushToken ( string  token)

Notifies adjust the device token for iOS and firebase push token for Android.

When set and configured on the Adjust dashboard, Adjust will track uninstall and re-install events.

Parameters
tokenThe Firebase push token for Android or the base64 encoded device token for iOS

◆ SetSwrveButtonListener()

void Kongregate.IAnalytics.SetSwrveButtonListener ( string  gameObjectName,
string  functionName 
)

Sets the callback listener for Swrve in-app messages (http://docs.swrve.com/user-documentation/in-app-messaging/).

Will be invoked when a deep link is selected as the message Action.

Parameters
gameObjectNamethe game object to handle the action
functionNamethe function on the game object that will be invoked

◆ Start()

void Kongregate.IAnalytics.Start ( )

When using KongregateSettings.DeferAnalytics, this allows you to start the analytics subsystem.

You should attempt to call this function as quickly as possible after initializing the SDK, or you may miss events.

◆ StartDeltaDNA()

void Kongregate.IAnalytics.StartDeltaDNA ( )

Internal method to start Unity DeltaDNA analytics separately.

Will fail if Kong Analytics has not yet been initialized.

◆ StartPurchase() [1/2]

void Kongregate.IAnalytics.StartPurchase ( string  productID,
int  quantity,
Dictionary< string, object >  gameFields 
)

Creates an Adjust/Swrve iap_attemps event.

The SKU must match the one set up in the iTunes Connect portal, and must contain the pricing tier, such as: t05_hard.

Be careful not to start multiple purchase flows at once. Disable the UI that initiates the purchase flow until it's complete or cancelled.

Parameters
productIDThe product ID
quantityThe quantity of items purchased
gameFieldsAn optional dictionary containing custom event fields to pass along

◆ StartPurchase() [2/2]

void Kongregate.IAnalytics.StartPurchase ( string  productID,
int  quantity,
string  gameFieldsJson 
)

Creates an Adjust/Swrve iap_attemps event.

The SKU must match the one set up in the iTunes Connect portal, and must contain the pricing tier, such as: t05_hard.

Be careful not to start multiple purchase flows at once. Disable the UI that initiates the purchase flow until it's complete or cancelled.

Parameters
productIDThe product ID
quantityThe quantity of items purchased
gameFieldsJsonAn optional JSON string containing custom event fields to pass along

◆ TrackPurchase() [1/2]

void Kongregate.IAnalytics.TrackPurchase ( string  productID,
int  quantity 
)

◆ TrackPurchase() [2/2]

void Kongregate.IAnalytics.TrackPurchase ( string  productID,
int  quantity,
Dictionary< string, object >  fields 
)

◆ UpdateCommonProps()

void Kongregate.IAnalytics.UpdateCommonProps ( )

Manually run the common properties delegate to update the properties.

In general you should not need to call this


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