appodeal.trackInAppPurchase()

Type Function
Return value none
Revision Release 2022.3683
Keywords ads, advertising, Appodeal, trackInAppPurchase
See also appodeal.init()
appodeal.*

Overview

Important

This method is not supported by the legacy plugin version]. Make sure to use new modular plugin or beta to get the latest and greatest.

This method helps you keep track of an inApp purchase. It allows to group users by the fact of purchasing in-apps. This will help you adjust the ads for such users or simply turn it off, if needed.

Syntax

appodeal.trackInAppPurchase( options )
options (required)

Table. Table containing option values — see the next section for details.

Options Reference

The options table includes parameters for specifying user details.

amount (required)

Number. In app purchase cost amount.

currency (required)

String. In app purchase currency. Should be ISO 4217 Code (3 digit code).

Example

local appodeal = require( "plugin.appodeal" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Track inApp purchase
        appodeal.trackInAppPurchase( { amount = 10, currency = "USD" } )
    end
end

-- Initialize the Appodeal plugin
appodeal.init( adListener, { appKey = "YOUR_APP_KEY" } )