inMobi.setUserDetails()

Type Function
Return value none
Revision 2017.3060
Keywords ads, advertising, InMobi, setUserDetails
See also inMobi.load()
inMobi.*

Overview

Allows you to set user-specific details for more fine-grained ad targeting.

Syntax

inMobi.setUserDetails( params )
params (required)

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

Parameter Reference

The params table can include the following user-specific details:

gender (optional)

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

userInterests (optional)

Table. Table of strings indicating the user's interests. You can supply any or all of the following strings: "Business", "Tech", "Travel", "Shopping", "Entertainment", "Fashion", "Fitness", "Foodie", "Gamer", "Jobs", or "Sports". You must supply at least one value for this parameter to apply.

phoneAreaCode (optional)

String. The area code of the user's phone number. For instance, the Republic of Ireland's area code is "353".

postCode (optional)

String. The user's post/postal code.

birthYear (optional)

Number. The user's birth year, for instance 1986.

age (optional)

Number. The user's age, for instance 30.

ageGroup (optional)

String. The user's age group. Valid options are "18AndUnder", "55AndAbove", "18To20", "21To24", "25To34", or "35To54".

education (optional)

String. The user's education level. Valid options are "highSchoolOrLess", "collegeOrGraduate", or "graduateOrAbove".

ethnicity (optional)

String. The user's ethnicity. Valid options are "hispanic", "caucasian", "asian", "africanAmerican", or "other".

Example

local inMobi = require( "plugin.inMobi" )

local function adListener( event )

    if ( event.phase == "init" ) then  -- Successful initialization
        print( event.isError )
    end
end

-- Initialize the InMobi plugin
inMobi.init( adListener, { accountId="YOUR_ACCOUNT_ID", logLevel="debug" } )

-- Set the user details
inMobi.setUserDetails(
    {
        gender = "male",
        userInterests = { "Business", "Tech" },
        postCode = "K1A0B1",
        ageGroup = "25To34",
        education = "collegeOrGraduate",
        ethnicity = "other"
    })