Type Function Return value none Revision 2017.3060 Keywords analytics, attribution, Kochava, logCustomEvent See also kochava.logStandardEvent() kochava.logDeeplinkEvent() kochava.*
Sends a custom event to Kochava.
This function replaces the previous kochava.logEvent() function. For backward compatibility, logEvent()
will continue to work, however we recommend that you update your code to use this logCustomEvent()
instead. Essentially, logEvent()
has been deprecated and it will be removed in a future plugin update.
kochava.logCustomEvent( 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 Price
IAP: 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.logCustomEvent()
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, currency = "jpy", items_in_basket = 1, checkout_as_guest = false } ) logCustomEvent( "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.logCustomEvent( "CUSTOM_EVENT", "CUSTOM_EVENT_VALUE" )