Skip to main content
Version: 3.x

Initialization options

You can pass user attributes when you initialize the SDK. On Android they go in a TapInitOptions object; on iOS they are parameters of initialize.

Configuration options​

OptionDescriptionRequired?
userAttributesUser attributes; see User attributes and targetingNo
clearPreviousAttributesReplaces previously sent attributes with this set (default false), see belowNo

initialize takes an optional initOptions parameter of type TapInitOptions:

data class TapInitOptions(
val userAttributes: HashMap<String, Any>? = null,
val clearPreviousAttributes: Boolean? = false,
)

See SDK initialization for a full example.

User attributes in initialization​

Best practice: If user attributes are known at SDK initialization, pass them through initialization instead of using sendUserAttributes.

Benefit: Faster load times for targeted content.

Clearing previous attributes​

Attribute names must be strings and must not begin with tapresearch_, which is reserved for TapResearch. Use string or numeric values for targeting. For booleans, send "true"/"false" or 0/1 instead of native booleans.

Set clearPreviousAttributes to false to merge new values with existing attributes, or true to replace the attributes you previously sent.