revmob.setUserDetails()

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

Overview

Sets the user's details to receive more fine-grained (customized) ads from RevMob.

Syntax

revmob.setUserDetails( params )
params (required)

Table. Table containing user details — see the next section for details.

Parameter Reference

The params table includes parameters for RevMob ad customization.

gender (optional)

String. The user's gender. Valid values are "male" or "female".

userAgeRange (optional)

Table. A table specifying the age range of users to target. This table must contain the following key-value pairs:

  • min — A number representing the minimum age range to target.
  • max — A number representing the maximum age range to target.
userBirthday (optional)

Table. A table specifying the user's birthday (date of birth). This table must contain the following key-value pairs:

  • year — A number representing the user's birth year.
  • month — A number representing the user's birth month.
  • day — A number representing the user's birth day.
userInterests (optional)

Table. A table specifying the user's interests as a list of strings.

Example

local revmob = require( "plugin.revmob" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        -- Set user details
        revmob.setUserDetails(
            {
                gender = "male",
                userAgeRange = { min=18, max=40 },
                userBirthday = { year=1986, month=1, day=29 },
                userInterests = { "programming", "computers", "fishing", "cars" }
            })
    end
end

-- Initialize RevMob
revmob.init( adListener, { appId="YOUR_APP_ID" } )