Magnolia 6.1 reached end of life on March 31, 2021. This branch is no longer supported, see End-of-life policy.
Magnolia's cookie trait Cookies reads data from cookies with the CookieParameterConverter and uses the CookieVoter to render the appropriate content variation according to configuration.
The cookies trait and all its classes are part of the magnolia-personalization-traits submodule which is installed with the Personalization module. The cookie trait supports multiple cookies. You can configure as many cookies as you like for multiple use cases and use them simultaneously.
magnolia-personalization-traits installs a default configuration. You can add your own cookies by defining custom options in the:
The configuration is in /modules/personalization-traits/traits/cookies
. Use the Configuration app to edit.
Node name | Value |
---|---|
personalization-traits | |
traits | |
cookies | |
ruleField | |
valueField | |
converterClass | info.magnolia.personalization.cookie.CookieParameterConverter |
defaultPreviewTrait | false |
defaultRuleTrait | false |
traitClass | info.magnolia.personalization.cookie.Cookies |
voterClass | info.magnolia.personalization.cookie.CookieVoter |
Properties:
<cookie> | required Trait name. |
| required Field used to define permitted values for the trait. See Configuring the rule field below. |
| required Field used to set permitted values for personalized content delivery. See Configuring the value field below. |
| required CookieParameterConverter : Cookie parameter converter. |
| optional, default is Displays all cookie trait options in the Preview app by default when set to |
| optional. default is <insert> |
| required Cookies : Specifies the cookie trait. |
| required CookieVoter : Matches the cookie name to the cookie value. See Voters. |