This is an advanced and experimental feature and is not currently activated for all properties. If you would like to activate this feature for you, please get in touch with Support.
If you simply want to not show items older than a certain age, see our instructions to Set max age for recommended items.
In order for us to be able to apply time decay, you need to share the time of publication in the inventory items, with the field name published_time
(in ISO 8601 format). For more information on that, see Defining your Inventory.
Why this is usually not needed
Generally, if your goal is to optimize CTR or corresponding engagement metrics, explicit time decay rules are unnecessary and could be counterproductive. There are a couple of reasons:
- Our machine learning system automatically infers attributes such as whether an item is trending or stale, relying on user behavior. This inference is usually smarter than blind reliance on time since publication. For instance, an article published a long time ago that has become topically relevant recently can get picked up as trending.
- We should also smartly filter out items that users have already browsed or visited, and therefore people should not see an item again if they've already visited it.
Specify time decay globally, in inventory, and in queries (note: needs activation)
The time-decayed score computed by LiftIgniter is added to the rest of the score we compute in order to determine the total score of each item.
There are two parameters that control the way time decay works. These can be specified in the opts
in your register function.
timeDecayInitialScore
: This is the initial score attached to an item that has just been published. Essentially, it determines how much importance the time-decayed score has in determining the ranking relative to the rest of the score.halfLifeInSeconds
: This is the time (in seconds) that it takes for the score to be halved.
For instance, if you set a value of timeDecayInitialScore
of 16 and a halfLifeInSeconds
of 86400 (so 1 day), then the score for a just published item would be 16, the score for an item that is 1 day old would be 8, the score for an item that is 2 days old would be 4, the score for an item that is 3 days old would be 2, and so on.
The decay operates continuously (as exponential decay). So an item that is half a day old would have a score somewhere between the score for a brand-new item and an item that is 1 day old.
As alternatives to specifying the parameters timeDecayInitialScore
and halfLifeInSeconds
as part of the query, you can:
- Give us the values so we can set those up as the default values (default values are overridden by the values specified in the query, if you choose to so specify them).
- Specify them as part of individual inventory items (so that you can vary them based on the item). This would allow you to decay different items at different rates. The value within an individual inventory item, if present, takes precedence over default values and over the values specified in the query.