horizon_select(array,n)
Given an array of objects, picks the n objects that the user has the highest interest in, sorted by descending level of interest.
The objects in the array can contain any number of properties, but they must contain the tags property, which must be a comma-separated string or array of strings listing the tags that are relevant to this piece of content.
You also may use the weight property, which can be any number to weight the value of the piece of content. For example, if you are pulling headlines from your site you probably want to give higher weight to headlines with higher numbers of pageviews.
There are many handy uses for this function, but one of the most useful involves combining it with data from a Data Feed. For more on this, see Behavioral Headlines.
{mytwofavoritefruitsnacks = horizon_select([
{'tag':'grape',name:'Grape Fruit Snacks',weight:100},
{'tag':'apple,cranberry',name:'Cran-Apple Fruit Snacks',weight:150},
{'tag':'lemon',name:'Lemon Fruit Snacks',weight:50}
], 2})}
Your favorite fruit snacks are {mytwofavoritefruitsnacks[0].name} and {mytwofavoritefruitsnacks[1].name}.