-
Notifications
You must be signed in to change notification settings - Fork 7
Full Docs
- Moving markdown file to wiki page(s).
- Adding details for personalization PR.
NEW DOCS BELOW
Force some user properties to be dynamically controlled by user behavior tracking of hits to taxonomy tagged pages. You'll need to specifically call out which user properties can be updated this way and by which favorites.
groucho.config.favorites = [{
userProperty: 'user.genre',
favoritesKey: 'music_genre',
overwrite: true
}, {
userProperty: 'user.role',
favoritesKey: 'audience_type',
overwrite: false
}];
- userProperty - localStorage value to adjust automatically.
- favoritesKey - Tag vocabulary to discover favorites.
- overwrite - Should favorites overwrite existing values (used if value can be set by user).
You can easily filter and/or reveal content based on each users' personal preferences. You'll need to create groucho panes and user data attributes to indicate which items correspond to which user values.
<section data-groucho-pane="user.genre" class="hidden">
<span data-groucho="pop">Gaga</span>
<span data-groucho="rock">Zeppelin</span>
</section>
<div data-groucho-pane="user.leadStatus" class="hidden">
<a href="/order-history" data-groucho="customer">Past Orders</a>
</div>
Groucho will find panes and process each element with a groucho
data attribute. You are essentially referencing localStorage values to choose what's visible.
Note: The markup allows for both initially hidden and initially shown panes and elements. It's recommended to include a CSS rule like [data-groucho-pane].hidden { visibility:hidden }
as this library is purely JS.
Force specific user preference personalization with URL param overrides. This allows ensuring specific page element visibility regardless of user values, as well as adjusting pages when the no user preferences exist yet.
http://www.example.com/my-page?music=pop&campaign=summer
groucho.config.overrides = [{
parameter: 'music',
userProperty: 'user.genre'
}, {
parameter: 'campaign',
userProperty: 'campaign'
}];