horizon_set_interest

Description

Manually sets a user’s interest level on a particular tag temporarily, for the duration of the send.
 horizon_set_interest( mixed tags , float score [, boolean only_increase ] )
Set the current user’s Horizon score for a particular tag or set of tags. This has no permanent impact on the user and only affects subsequent calls within the current message scope. This function is most useful to integrate a custom set of tags or user preferences with Horizon-collected data. For example, if the user has expressed the preference that they are interested in artand music, and you want to define user preferences as being equivalent to a Horizon interest score of 5, you can set that directly using this function.

Example

 {horizon_set_interest(['art','music'],5)}
If the only_increaseparameter is set to true, then the interest score will only increase from its current value. So a user who already has a score of 10 will not be reduced to 5.
 {horizon_set_interest(['art','music'],5,true)}

Override User Interest Level with Custom Field Data (Tag Only)

Use Case: You have an array of interests that you capture on your users upon signup, and for the first month a user is subscribed, you’d like to use those interests to recommend content until while Sailthru ingests user interest data.

Zephyr: On the profile:


zephyr example my_interests array

In the Setup:

{if profile.signup_time < time("30 days")}
{horizon_set_interest(profile.vars.my_interests,5)}
{/if}

This will, for the purpose of that send (and for the first 30 days of the user being on the list), inflate those three values to a level of 5.

Explanation: This script uses the horizon_set_interest() function to adjust user interest level data based on a custom field collected stored as an array of values. As this can be beneficial to show new users content during their first few weeks post signup, this script is wrapped in a conditional “if” statement. If the user’s signup time is less than 30 days ago (i.e. they’ve signed up in the last 30 days), run the horizon_set_interest() script to set the interest level of each to 5x that average level. Otherwise, Sailthru will use the interest generated purely from on-site browsing.

Override User Interest Level with Custom Field Data (Tag and Score)

Use Case: You have an array of interests and an applicable score that you capture on your users upon signup, and for the first month a user is subscribed, you’d like to use those interests to recommend content until while Sailthru ingests user interest data.

Zephyr: On the profile:
zephyr example my_interests_score tag array

In the Setup:

{if profile.signup_time < time("30 days")}
{foreach my_interests_score as c}
{horizon_set_interest(c.tag,c.score,true)}
{/foreach}
{/if}

This will, for the purposes of that send (and for the first 30 days of the user being on the list), inflate those three values to the “score” level on in the custom field. However, by having “true” in the third field, the level won’t change unless the actual score is higher (i.e. if my Sailthru-captured user interest is now 10, it won’t be reduced to a level of 1).

Explanation: This script uses the horizon_set_interest() function to adjust user interest level data based on a custom field collected, in this instance, tags with an applicable “score.” The foreach statement loops through this custom field and sets whatever is stored as the “score” value and applies it to the applicable “tag” value for each user. If the current Sailthru-tracked user interest level for that tag is higher than the value in the custom field, the “true” parameter allows Sailthru to use that higher value. As this can be beneficial to show new users content during their first few weeks post signup, this script is wrapped in a conditional “if” statement. If the user’s signup time is less than 30 days ago (i.e. they’ve signed up in the last 30 days), run the horizon_set_interest() script. Otherwise, Sailthru will use the interest generated purely from on-site browsing.

Contact us

Top