Type Function Return value none Revision 2017.3060 Keywords analytics, attribution, Tenjin, logPurchase See also tenjin.init() tenjin.logEvent() tenjin.*
Sends an IAP purchase event to Tenjin.
tenjin.logPurchase( purchaseData [, purchaseReceipt] )
Table. Table containing IAP purchase data — see the next section for details.
Table. An optional table containing
The purchaseData table includes parameters for logging IAP purchases.
String. The product ID/name for the IAP purchase.
String. The currency of the IAP transaction.
Number. The number of units bought.
Number. The unit price of the IAP item.
The purchaseReceipt table includes parameters for logging IAP receipts.
String. This parameter is an event.transaction.receipt found in the
String. This parameter applies to Google Play transactions only and is mandatory when logging a Google IAP receipt. It expects the data from event.transaction.signature found in the
local tenjin = require( "plugin.tenjin" )
local function tenjinListener( event )
-- Handle events here
end
-- Initialize plugin
tenjin.init( tenjinListener, { apiKey="YOUR_API_KEY" } )
-- Sometime later, log an IAP purchase
tenjin.logPurchase(
{
productId = "Bonus Pack",
currencyCode = "USD",
quantity = 1,
unitPrice = 0.99
}
)