Type Function
Return value none
Revision Release 2024.3703
Keywords ads, advertising, Pollfish, setUserDetails
See also pollfish.init()


Sets user details. Providing these details may help improve revenue with offers targeted for the user.


pollfish.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.

gender (optional)

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

facebookId (optional)

String. User's Facebook ID.

twitterId (optional)

String. User's Twitter ID.

location (optional)

Table. User's location. The location table includes the following parameters for specifying user location:

  • longitude — Optional number representing longitude.
  • latitude — Optional number representing latitude.
  • horizontalAccuracy — Optional number representing horizontal accuracy.

Note that this table is only used for iOS. For Android you can get automatic location retrieval by setting the "android.permission.ACCESS_FINE_LOCATION" and "android.permission.ACCESS_COARSE_LOCATION" permissions.

requestUUID (optional)

String. A unique ID to identify a user. This ID is also passed through server-to-server callbacks.


local pollfish = require( "plugin.pollfish" )

local function adListener( event )

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

-- Initialize the Pollfish plugin
pollfish.init( adListener, { apiKey="YOUR_API_KEY" } )

-- Set user details
pollfish.setUserDetails( { gender="female" } )