This documentation is still in progress. We are working hard to update all our screenshots to the new Magnolia 6 style. Please bear with us.

Page tree
Skip to end of metadata
Go to start of metadata

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 nameValue

 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.

ruleField

required

Field used to define permitted values for the trait. See Configuring the rule field below.

valueField

required

Field used to set permitted values for personalized content delivery. See Configuring the value field below.

converterClass

required

CookieParameterConverter : Cookie parameter converter.

defaultPreviewTrait

optionaldefault is false

Displays all cookie trait options in the Preview app by default when set to true.

defaultRuleTrait

optional. default is false

<insert>

traitClass

required

Cookies : Specifies the cookie trait.

voterClass

required

CookieVoter : Matches the cookie name to the cookie value. See Voters.