horizon_count

Returns the total number of times the user has visited a page with that tag or tags.

Copy
horizon_count('<tag1,optionaltag2,[..]>')

Example

Determine Content to Show Based on Page Count

Use Case:

You want to display top content from a merged feed, and you want user browsing activity to dictate which feed the top item should come from, where the “blog” site (Media feed) or the “storefront” site (Ecomm feed). As all Media pages are tagged with site-blog and Ecomm articles with “site-store”, the horizon_count() function can see which pages a user has visited more. If the user has a higher interest in blog content, lead with that. Otherwise, show store content.

Zephyr:

In the Setup:

{mediaContent = personalize({
   "algorithm" : "interest",
   "size": 3,
   "content" : media.content
})}
{ecommContent = personalize({
   "algorithm" : "interest",
   "size": 3,
   "content" : ecomm.content
})}

In the Code:

{if horizon_count("site-blog") > horizon_count("site-store")}
{mediaContent[0].title}
{else}
{ecommContent[0].title}
{/if}