Upsight logo Back to top

Advanced Messages

applicationAdded

Overview


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

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

applicationAdded

Overload List


Method CallParameters
void applicationAdded( Dictionary<string, string> optionalParams )
  • optionalParams

applicationAdded

Parameters


ParameterTypeDescription
optionalParamsDictionary<string, string>A Dictionary with that can hold extra information. The keys that you can use and the value they should represent are listed in the Optional Parameters section below.

applicationAdded

Optional Parameters


Description Parameter Input Description
Short tracking tags su A comma-separated list of device identifiers such as IDFA and IDFV.

Valid characters are a-f, A-F, and 0-9. This parameter must match the su parameter in the associated ucc API call.

Important! This variable is required if the installation occurred from an undirected communication click (such as an ad or partner link) and must follow a ucc API message call. If this tag is not included from installs resulting from an undirected communication click, traffic source information will not be properly attributed.
Data data Additional data, a JSON object string representing a dictionary or map of key-value pairs. It must be base64-encoded. Click here for more information.
TimestamptsThis parameter should only be passed if the data for this request is generated significantly before the message is being delivered. This can happen when the app is used while the device is offline. If this parameter is not specified, the default value will be when the message was received.

applicationAdded

Code Example


KontagentBinding.applicationAdded(null);

createSession

Overview


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

createSession

Overload List


Method CallParameters
KontagentSession createSession(
        String apiKey,
        String senderId,
        Boolean isOnTestMode,
        Boolean doSendApplicationAdded,
        String facebookApplicationId )
  • apiKey
  • senderId
  • isOnTestMode
  • doSendApplicationAdded
  • facebookApplicationId

createSession

Parameters


ParameterTypeDescription
apiKeyStringThe API Key of your application. This key is automatically generated when you set up your application in your Dashboard.
senderIdStringA unique, unsigned 64-bit integer in the form of a String. This parameter denotes the unique identifier of the application user. If your application creates user IDs larger than 64-bits, you must convert the user ID to an unsigned 64-bit integer to send to Upsight Analytics. For more information click here.
isOnTestModeBooleanDetermines whether you send data to Upsight Analytics Test or Production servers. For Production, set this parameter to false. For Test, set this parameter to true. Default is false.
doSendApplicationAddedBooleanDetermines whether to send an application added message automatically on the first install. Default is true.
facebookApplicationIdStringYour unique app ID if you have a Facebook App associated with your app.

createSession

Code Example


String apiKey = "abcdefg12345678";
String senderId = "12345678";
Boolean isOnTestMode = false;
Boolean doSendApplicationAdded = true;

KontagentBinding.createSession(apiKey, senderId, isOnTestMode, doSendApplicationAdded, false);

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

Overload List


Method CallParameters
void customEvent(
        string eventName,
        Dictionary<string, string> optionalParams )
  • eventName
  • optionalParams

customEvent

Parameters


ParameterTypeDescription
eventNameStringThe event name, up to 31 characters long, describing the event. Valid characters are a-z, A-Z, 0-9, -, and _.
optionalParamsDictionary<string, string>A Dictionary with that can hold extra information. The keys that you can use and the value they should represent are listed in the Optional Parameters section below.

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


Send a Custom Event message with no Optional Parameters

KontagentBinding.customEvent("soundDisabled", null);

Send a Custom Event message with Optional Parameters

Dictionary<string, string> optionalParams = new Dictionary<string, string>();

optionalParams.Add("v", "42");
optionalParams.Add("l", "1");
optionalParams.Add("st1", "item_purchase");
optionalParams.Add("st2", "hat");
optionalParams.Add("st3", "blue");

revenueTracking

Overview


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

revenueTracking

Parameters


ParameterTypeDescription
valueintThe 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).
optionalParamsDictionary<string, string>A Dictionary with that can hold extra information. The keys that you can use and the value they should represent are listed in the Optional Parameters section below.

revenueTracking

Optional Parameters


DescriptionParameterInput Description
DatadataAdditional data, a JSON object string representing a dictionary or map of key-value pairs. It must be base64-encoded. Click here for more information.
TimestamptsThis parameter should only be passed if the data for this request is generated significantly before the message is being delivered. This can happen when the app is used while the device is offline. If this parameter is not specified, the default value will be when the message was received.

revenueTracking

Code Example


Send a monetization message with no type.

KontagentBinding.revenueTracking(itemPrice, null);

Send a monetization message with a data object.

KontagentBinding.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

Overload List


Method CallParameters
void setSecureHttpConnectionEnabled(bool isEnabled)
  • isEnabled

setSecureHttpConnectionEnabled

Parameters


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

setSecureHttpConnectionEnabled

Code Example


Enable Secure HTTP Connection

KontagentBinding.setSecureHttpConnectionEnabled(true);

Disable Secure HTTP Connection

KontagentBinding.setSecureHttpConnectionEnabled(false);

isSecureHttpConnectionEnabled

Overview


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

isSecureHttpConnectionEnabled

Overload List


Method CallParameters
bool isSecureHttpConnectionEnabled()

isSecureHttpConnectionEnabled

Parameters


No parameters are required.

isSecureHttpConnectionEnabled

Code Example


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

KontagentBinding.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.

Note This method is for Android only.

startHeartbeatTimer

Overload List


Method CallParameters
void startHeartbeatTimer()

startHeartbeatTimer

Parameters


No parameters are required.

startHeartbeatTimer

Code Example


KontagentBinding.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.

Note This method is for Android only.

stopHeartbeatTimer

Overload List


Method CallParameters
void stopHeartbeatTimer()

stopHeartbeatTimer

Parameters


No parameters are required.

stopHeartbeatTimer

Code Example


KontagentBinding.stopHeartbeatTimer();