appodeal.setUserDetails()

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

Overview

Sets user details. Providing these details may help improve revenue with ads that are more specifically targeted for the user.

Syntax

appodeal.setUserDetails( 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.

age (optional)

Number. The user's age.

gender (optional)

String. The user's gender. Valid values include "male", "female", and "other".

userId (optional)

String. A unique ID to identify a user.

Example

local appodeal = require( "plugin.appodeal" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Set user details
        appodeal.setUserDetails( { gender="female" } )
    end
end

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