Skip to content
Josh Lind edited this page May 9, 2017 · 33 revisions

Work In Progress, NOT YET ACCURATE


EXISTING FULL DOCS

NEW DOCS BELOW

Favorites

Managed Favorites

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.

Example Configuration

groucho.config.favorites = [{
    userProperty: 'user.genre',
    favoritesKey: 'music_genre',
    overwrite: true
  }, {
    userProperty: 'user.role',
    favoritesKey: 'audience_type',
    overwrite: false
}];

Details

  • 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).

Personalization

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.

Example Adjustments

<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.

Param Overrides

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.

Example URL

http://www.example.com/my-page?music=pop&campaign=summer

Example Configuration

groucho.config.overrides = [{
    parameter: 'music',
    userProperty: 'user.genre'
  }, {
    parameter: 'campaign',
    userProperty: 'campaign'
}];
Clone this wiki locally