Type Function Return value none Revision 2017.3060 Keywords analytics, attribution, Kochava, logEvent See also kochava.logDeeplinkEvent() kochava.*
Sends an event to Kochava.
This function is deprecated and it has been replaced with the kochava.logCustomEvent() function. For backward compatibility, this function will continue to work, but it will be removed in a future plugin update and we recommend that you update your code to use kochava.logCustomEvent() instead.
kochava.logEvent( eventName [, eventValue, receipt, googleDataSignature] )
String. The name of the event. Note that event names cannot start with an underscore (_).
String. An optional event value — see the next section for details.
String. An optional event.transaction.receipt found in the
String. This parameter is mandatory when logging a Google IAP receipt. It expects the data from event.transaction.signature found in the
The optional eventValue parameter may be used for any of the following:
eventName parameter.If the string passed in eventValue is all numeric, potentially including a decimal point, Kochava will automatically sum the amounts passed in eventValue for the associated eventName. For example, if you send the purchase amount of eventValue and set eventName as IAP: Purchase PriceIAP: Purchase Price
Regardless of what is passed in eventValue, Kochava's user dashboard will let you access all of the data passed in eventValue for any eventName and present a count of all the times kochava.logEvent() passed it.
When logging an app store receipt via eventValue, it's recommended that you provide a table with the following properties, formatted as a JSON string:
local eventValuePayload = json.encode(
{
customer_id = "internalCustomerId",
sum = 0.99,
items_in_basket = 1,
checkout_as_guest = false
}
)
logEvent( "bonusPackPurchase", eventValuePayload, event.transaction.receipt )
local kochava = require( "plugin.kochava" )
local function kochavaListener( event )
-- Handle events here
end
-- Initialize plugin
kochava.init( kochavaListener,
{
appGUID = "YOUR_APP_GUID"
}
)
kochava.logEvent( "CUSTOM_EVENT", "CUSTOM_EVENT_VALUE" )