Class Index | File Index

Classes


Class KiiAnalytics

The main SDK class
Defined in: KiiSDK.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
<static>  
KiiAnalytics.getAppID()
Retrieve the current app ID
<static>  
KiiAnalytics.getAppKey()
Retrieve the current app key
<static>  
KiiAnalytics.getDeviceId()
Get the deviceId.
<static>  
KiiAnalytics.getSDKVersion()
<static>  
KiiAnalytics.initialize(String, String, deviceid)
<static>  
KiiAnalytics.initializeWithSite(String, String, KiiAnalyticsSite, deviceid)
<static>  
KiiAnalytics.isLogging()
Is the SDK printing logs to the console?
<static>  
KiiAnalytics.logger(String)
Utilize the KiiAnalytics logger to track SDK-specific actions Helpful for development - we strongly advice you turn off logging for any production code.
<static>  
KiiAnalytics.setBaseURL(String)
<static>  
KiiAnalytics.setLogging(Boolean)
Set the logging status of the SDK Helpful for development - we strongly advice you turn off logging for any production code.
<static>  
KiiAnalytics.trackEvent(eventName)
Log a single event to be uploaded to KiiAnalytics Use this method if you'd like to track an event by name only.
<static>  
KiiAnalytics.trackEventWithExtras(eventName, extras)
Log a single event to be uploaded to KiiAnalytics Use this method if you'd like to track an event by name and add extra information to the event.
<static>  
KiiAnalytics.trackEventWithExtrasAndCallbacks(eventName, extras, callbacks)
Log a single event to be uploaded to KiiAnalytics Use this method if you'd like to track an event asynchronously by name and add extra information to the event.
Class Detail
KiiAnalytics()
Method Detail
<static> {String} KiiAnalytics.getAppID()
Retrieve the current app ID
Returns:
{String} The current app ID

<static> {String} KiiAnalytics.getAppKey()
Retrieve the current app key
Returns:
{String} The current app key

<static> {String} KiiAnalytics.getDeviceId()
Get the deviceId. If deviceId has not specified while initialization, it returns SDK generated deviceId.It is recommended to retrieve the deviceId and store it to identify the device properly.
Returns:
{String} deviceId.

<static> {String} KiiAnalytics.getSDKVersion()
Deprecated:
Use Kii.getSDKVersion instead. Kii Analytics SDK Version Number
Returns:
{String} current version number of the SDK

<static> KiiAnalytics.initialize(String, String, deviceid)
  // initialize without deviceId
  Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP);
  // initialize with deviceId
  Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id");
Parameters:
String
appID The application ID found in your Kii developer console
String
appKey The application key found in your Kii developer console
deviceid
If deviceId is not provided, SDK generates a new deviceId and use it when upload events. deviceId can be retrieved by KiiAnalytics.getDeviceId().It is recommended to retrieve the deviceId and store it to identify the device properly.
Deprecated:
Use Kii.initialize instead. Initialize the KiiAnalytics SDK Should be the first KiiAnalytics SDK action your application makes

<static> KiiAnalytics.initializeWithSite(String, String, KiiAnalyticsSite, deviceid)
  // initialize without deviceId
  Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP);
  // initialize with deviceId
  Kii.initializeWithSite("my-app-id", "my-app-key", KiiAnalyticsSite.JP, "my-device-id");
Parameters:
String
appID The application ID found in your Kii developer console
String
appKey The application key found in your Kii developer console
KiiAnalyticsSite
site Can be one of the constants KiiAnalyticsSite.US, KiiAnalyticsSite.JP, KiiAnalyticsSite.CN, KiiAnalyticsSite.CN3 or KiiAnalyticsSite.SG depending on your location.
deviceid
If deviceId is not provided, SDK generates a new deviceId and use it when upload events.deviceId can be retrieved by KiiAnalytics.getDeviceId().It is recommended to retrieve the deviceId and store it to identify the device properly.
Deprecated:
Use Kii.initializeWithSite instead. Initialize the Kii SDK with a specific URL Should be the first Kii SDK action your application makes

<static> {Boolean} KiiAnalytics.isLogging()
Is the SDK printing logs to the console?
Returns:
{Boolean} True if printing logs, false otherwise

<static> KiiAnalytics.logger(String)
Utilize the KiiAnalytics logger to track SDK-specific actions Helpful for development - we strongly advice you turn off logging for any production code.
      KiiAnalytics.logger("My message");
Parameters:
String
message The message to print to console.log in your browser

<static> KiiAnalytics.setBaseURL(String)
Parameters:
String
url A string containing the desired endpoint
Deprecated:
Set a custom API endpoint URL

<static> KiiAnalytics.setLogging(Boolean)
Set the logging status of the SDK Helpful for development - we strongly advice you turn off logging for any production code.
      KiiAnalytics.setLogging(true);
Parameters:
Boolean
True if logs should be printed, false otherwise

<static> {Promise} KiiAnalytics.trackEvent(eventName)
Log a single event to be uploaded to KiiAnalytics Use this method if you'd like to track an event by name only. If you'd like to track other attributes/dimensions, please use KiiAnalytics.trackEventWithExtras(eventName, parameters)
Parameters:
{String} eventName
A string representing the event name for later tracking
Returns:
{Promise} return promise object.
  • fulfill callback function: function(). No parameters.
  • reject callback function: function(error). error is an Error instance.
    • error.message

<static> {Promise} KiiAnalytics.trackEventWithExtras(eventName, extras)
Log a single event to be uploaded to KiiAnalytics Use this method if you'd like to track an event by name and add extra information to the event.
Parameters:
{String} eventName
A string representing the event name for later tracking
{Object} extras
A dictionary of JSON-encodable key/value pairs to be attached to the event. Key must follow the pattern "^[a-zA-Z][a-zA-Z0-9_]{0,63}$".Supported value type is string, number, boolean and array. Empty string or empty array will be considered as invalid.Type of array elements must be string, number or boolean. If any key/value pair is invalid, it will be ignored and not sent to the KiiCloud.
Returns:
{Promise} return promise object.
  • fulfill callback function: function(). No parameters.
  • reject callback function: function(error). error is an Error instance.
    • error.message

<static> {Promise} KiiAnalytics.trackEventWithExtrasAndCallbacks(eventName, extras, callbacks)
Log a single event to be uploaded to KiiAnalytics Use this method if you'd like to track an event asynchronously by name and add extra information to the event.
Parameters:
{String} eventName
A string representing the event name for later tracking
{Object} extras
A dictionary of JSON-encodable key/value pairs to be attached to the event. Key must follow the pattern "^[a-zA-Z][a-zA-Z0-9_]{0,63}$".Supported value type is string, number, boolean and array. Empty string or empty array will be considered as invalid.Type of array elements must be string, number or boolean. If any key/value pair is invalid, it will be ignored and not sent to the KiiCloud.
{Object} callbacks
An object with callback methods defined
{Method} callbacks.success
The callback method to call on a successful log request
{Method} callbacks.failure
The callback method to call on a failed log request
Returns:
{Promise} return promise object.
  • fulfill callback function: function(). No parameters.
  • reject callback function: function(error). error is an Error instance.
    • error.message

Documentation generated by JsDoc Toolkit 2.4.0 on Mon May 21 2018 05:13:31 GMT-0000 (UTC)