Attributes
A dictionary of attributes to pass to Rokt to better tailor experience for a user.
example
{
firstName: 'Alice',
lastName: 'Smith',
}
Indexable
- [ attributeKey: string]: string | number | boolean | undefined
Any other attributes.
example
{
firstName: 'Alice',
lastName: 'Smith',
}
Properties
Optional
country
• country? : undefined | string
User's country code. If no Attributes.locale has been provided and other methods used by Rokt are not sufficient Rokt can use country
value
to drive selection of a language to display on placements.
The format of the value should adhere to ISO 3166-1 alpha-2 country code.
example
US
example
AU
see
Attributes.locale for information on requesting a language to display
Optional
locale
• locale? : undefined | string
Locale to be used in displayed placements. If your site supports multiple languages, you can use locale
to request placements to be displayed
in the language determined based on the attribute value.
If no value provided Rokt will try to establish user's preferred locale based on browser's setting, user location or will use your configured settings.
The format of the value should adhere to ISO639-1 language code with an optional hyphen separated ISO3166-1 alpha-2 country code.
example
en
example
en-AU
Optional
userAgent
• userAgent? : undefined | string
User's user agent, defaults to browser's user agent but can be overridden.
default
Browser's user agent.