Skip to main content

Optional Parameters

AdGem iOS SDK offers an API to store several optional user value fields such as age, gender, player ID, etc. These values can then be retrieved again on each conversion postback and/or used to segment your audiences and optimize your mobile ad revenue earnings.

Example

let metaData = AdGemPlayerMetadata.Builder
.initWithPlayerId(playerId: "abc123")
.playerAge(age: 20)
.playerGender(gender: .male)
.playerLevel(level: 5)
.playerPlacement(place: 1000)
.playerPayer(spentMoney: true)
.playerIAPTotal(iapTotal: 10.0)
.playerCreatedAt(creationDate: someDateTime!)
.customField1(field: "custom_field_1")
.customField2(field: "custom_field_2")
.customField3(field: "custom_field_3")
.customField4(field: "custom_field_4")
.customField5(field: "custom_field_5")
.build()

AdGem.setPlayerMetaData(metaData: metaData)

Parameter Reference

note

All parameter names and their values are case-sensitive.

ParameterTypePropertyDescription
playerIDstringid()Required for fraud protection. User's unique ID on your system
ageintegerplayerAge()User's age
genderAdGemGenderplayerGender()User's gender
spentMoneybooleanplayerPayer()Boolean value to set whether that player has made an in-app purchase or not
iapTotalintegerplayerIAPTotal()If the player has made an in-app purchase, the total is set here
createdDatetimestampplayerCreatedAt()Timestamp without the time zone
levelintegerplayerLevel()The level that the player has achieved
placeintegerplayerPlacement()Integer value that represents player's placement/rank
variablevarcharcustomField1()Custom field 1
variablevarcharcustomField2()Custom field 2
variablevarcharcustomField3()Custom field 3
variablevarcharcustomField4()Custom field 4
variablevarcharcustomField5()Custom field 5