Upsight logo Back to top

Advanced Messages

applicationAdded

Overview


Call this method if startSession is called, and sendApplicationAdded is set to false.

The presence of a unique tracking tag u or short tracking tag su is used to determine installation source.

applicationAdded

Required Parameters


No required parameters.

applicationAdded

Optional Parameters


No optional parameters.

applicationAdded

Code Example


Kontagent.applicationAdded();

createSession

Overview


Call this method to create a Kontagent object. Use this method if you wish to send to multiple API Keys.

To put a KontagentSession into TEST mode, use the setMode function.

createSession

Required Parameters


Parameter Type Description
contextcontext Context is required for internal Database support.
apiKeystring The API Key of your application. This key is automatically generated when you set up your application in your Dashboard.

createSession

Optional Parameters


Parameter Type Description
senderIDunsigned 64-bit int Unique long value in the form of String. By default UID will be generated within SDK.
sdkModestringPRODUCTION or TEST (ISession.KONTAGENT_SDK_MODE_PRODUCTION / ISession.KONTAGENT_SDK_MODE_TEST)
sendApplicationAddedBOOL When TRUE - applicationAdded request will be sent automatically from start method of ISession object.

createSession

Code Example


You need to know your API Key. The senderID can be nil, the Kontagent library will fill this in for you.

ISession session = Kontagent.createSession(this, API_KEY, sender_id,
ISession.KONTAGENT_SDK_MODE_PRODUCTION);

Start the Kontagent session.

session.start();

customEvent

Overview


Send this API call when a user performs a specific action in your application. This action can be anything that you deem valuable to track, such as the sale of a specific item, or progression to another level in a game.

customEvent

Required Parameters


Parameter Type Description
namestring The event name, up to 31 characters long, describing the event. Valid characters are a-z, A-Z, 0-9, -, and _.

customEvent

Optional Parameters


Parameter Type Description
vsigned int An arbitrary value you assign to associate with the event. The default value is 0.
lunsigned 8-bit int A level value can be associated to an action to indicate what game level the user is on. It is possible to view aggregate event counts by level. The level must always be a positive integer in the range from 0 to 255. The default value is 0
st1string An alpha-numeric label, up to 31 characters long, to categorize the event. The characters - and _ are also valid. Not optional if st2 is used.
st2string An alpha-numeric label, up to 31 characters long, to categorize the event. The characters - and _ are also valid. Not optional if st3 is used.
st3string An alpha-numeric label, up to 31 characters long, to categorize the event. The characters - and _ are also valid.
datastring Additional data, a JSON object string representing a dictionary or map of key-value pairs. Click here for more information.

customEvent

Code Example


Kontagent.customEvent(<event name>, null);

params.put("st1", <subtype1>);
params.put("st2", <subtype2>);
params.put("st3", <subtype3>);
params.put("l", <level>);
params.put("v", <value>);
params.put("data", <data>);

Kontagent.customEvent(<eventname>, params);

revenueTracking

Overview


This message provides information for tracking revenue and monetization transactions by users.

Note If you are funnelling your data from the Upsight SDK into the Upsight Analytics Dashboard, do not send both Monetization messages through the Upsight Enterprise SDK and In-App Purchase Tracking through the Upsight SDK. Doing so will cause double-counting in your purchase data. To ensure your purchase data is accurate, if you are using both the Upsight SDK and the Upsight Enterprise SDK, only send in-app purchase tracking through the Upsight SDK, not both.

revenueTracking

Required Parameters


Parameter Type Description
vint The revenue value in cents. All values must be passed in cents, and not dollars. Example: $1.25 should be passed as 125. The maximum value that can be passed is 1000000 ($10,000).

revenueTracking

Optional Parameters


Parameter Type Description
datastring Additional data, a JSON object string representing a dictionary or map of key-value pairs. Click here for more information.

revenueTracking

Code Example


Send a monetization message with no type.

Kontagent.revenueTracking(itemPrice, null);

Send a monetization message with a data object.

Kontagent.revenueTracking(itemPrice, params);

setSecureHttpConnectionEnabled

Overview


This message enables or disables Secure HTTP connection (HTTPS). Even though messages are sent asynchronously, messages sent will respect the Secure HTTP connection setting that is set at the time the message is called.

Note The option to use HTTPS must be enabled on the Upsight servers before HTTPS is enabled on the SDK. If this message is sent before HTTPS is activated on the servers, the option may be overridden on the server side even if the user activates this method. Please contact your CSM to enable this option.

setSecureHttpConnectionEnabled

Required Parameters


ParameterTypeDescription
isEnabledbooleanDetermines whether to send messages to Upsight Analytics through HTTP or HTTPS.

setSecureHttpConnectionEnabled

Optional Parameters


No optional parameters.

setSecureHttpConnectionEnabled

Code Example


Enable Secure HTTP Connection

Kontagent.setSecureHttpConnectionEnabled(true);

Disable Secure HTTP Connection

Kontagent.setSecureHttpConnectionEnabled(false);

isSecureHttpConnectionEnabled

Overview


This message determines if Secure HTTP connection (HTTPS) is enabled or disabled.

isSecureHttpConnectionEnabled

Required Parameters


No required parameters.

isSecureHttpConnectionEnabled

Optional Parameters


No optional parameters.

isSecureHttpConnectionEnabled

Code Example


Return TRUE if HTTPS is enabled, FALSE if HTTPS is disabled.

Kontagent.isSecureHttpConnectionEnabled();

startHeartbeatTimer

Overview


Starts the session heartbeat if it is not already started. The heartbeat tracks session duration.

The session heartbeat is automatically started in startSession and automatically stopped in stopSession. Use this method if you wish to reduce the amount of heartbeat messages sent by manually starting and stopping the heartbeat. You can stop the heartbeat by calling stopHeartbeatTimer.

startHeartbeatTimer

Required Parameters


No required parameters.

startHeartbeatTimer

Optional Parameters


No optional parameters.

startHeartbeatTimer

Code Example


Kontagent.startHeartbeatTimer();

stopHeartbeatTimer

Overview


Stops the session heartbeat if it is not already stopped. The heartbeat tracks session duration.

The session heartbeat is automatically started in startSession and automatically stopped in stopSession. Use this method if you wish to reduce the amount of heartbeat messages sent by manually starting and stopping the heartbeat. You can start the heartbeat by calling startHeartbeatTimer.

stopHeartbeatTimer

Required Parameters


No required parameters.

stopHeartbeatTimer

Optional Parameters


No optional parameters.

stopHeartbeatTimer

Code Example


Kontagent.stopHeartbeatTimer();