Create content type: Personalization Rule
A personalization rule is an instruction that controls how personalization operates. Just like rules in the real world, a personalization rule describes two things:
What does this describe?How this will be implemented in this solution?CriteriaWhat needs to be true in order for the rule to take effect.This solution involves two criteria: visitor classification and enrichment tags assigned to the location in the list. For example, the personalization rule will take effect if the visitor is interested in a certain topic and the location is tagged with that same topic.ActionWhat happens when the condition is true.This solution supports two actions for when the criteria is true: the location will be boosted to the top of the list, or the location will be removed from the list.
The following steps describe how to create a content type that allows a content author to describe personalization rules.
- In Contentful, create the following content type:Name
Personalization Rule
Api IdentifierpersonalizationRule
- Add the following field:PropertyValueNotesField typeShort textName
Name
Field IDname
This field represents the Entry titleCheckedRequired fieldCheckedABOUT THIS STEPThis is a human-readable description of the personalization. - Add the following field:PropertyValueNotesField typeShort textName
Action
Field IDAction
Required fieldCheckedAccept only specified valuesCheckedboost
and hide
AppearanceDropdownABOUT THIS STEPThis field allows the content author to control the action for the personalization rule. This action is applied to the locations in the list when the criteria (not yet configured) is met. - Save the content type.
- Open the Uniform app configuration page.ABOUT THIS STEPYou get to the Uniform by by navigating to Apps > Installed apps > Uniform > Configure.
- Enable enrichment taggings on the content type.
- Enable personalization criteria on the content type.Be sure to click the Save button
- Return to the content type.
- Rename the following fields:Current nameNew nameNotesEnrichment Tags
Content Criteria
This field represents part of the personalization rule's criteria. It allows content authors to specify the enrichment tags that must be assigned to the location in order for the personalization rule to take effect.Personalization CriteriaVisitor Criteria
This field represents part of the personalization rule's criteria. It allows content authors to specify the classification dimensions must be true of the visitor's session in order for the personalization rule to take effect. - Add the following field:PropertyValueNotesField typeShort textName
Content Criteria Match Type
Field IDcontentCriteriaMatchType
Accept only specified valuesCheckedall
and any
AppearanceRadioABOUT THIS STEPThis field represents part of the personalization rule's criteria. The field Content Criteria
allows the content author to select multiple enrichment tags. This field allows the content author to specify specify how many of the selected enrichment tags must be set on the content in order for the rule to take effect: all
means every one of the selected tags must be set, while any
means just one of the selected tags must be set (any
). - Change the order of the fields to the following:PositionField name1Name2Action3Visitor Criteria4Content Criteria5Content Criteria Match Type
- Save the content type.
Update content type: Location
In this example, a content type already exists that represents a location. Enrichment tagging has already been enabled on the content type, so no changes are needed.
Update content type: Curated Location List
In this example, a content type already exists that represents a location list. You need to add the ability for content authors to assign personalization rules so they can control personalization.
- Open the content type Curated Location List.
- Add the following field:PropertyValueNotesField typeReferenceName
Personalization Rules
Field IDpersonalizationRules
TypeMany referencesRequired fieldCheckedAccept only specified entry typeCheckedPersonalization RuleAppearanceDropdownABOUT THIS STEPThis field allows the content author select the personalization rules that apply to the entries in the field Locations. - Change the order of the fields to the following:PositionField name1Title2Personalization Rules3Locations
- Save the content type.