You can set a maximum allowed age for the items recommended. Note that this feature will work only if you are including the "published_time" field
in the inventory metadata (see our article on timestamp fields for more information). Once that field is included in item metadata, you'll be able to use the filter below.
Keep in mind that implementing a Max Age filter can cause a CTR drop as we'll be blocked from showing highly relevant content if it is too old.
Set Maximum Age
You need to specify the maximum age in seconds in the "opts" parameter of each widget's code, using the field name "maxAgeInSeconds".
Here's an example:
$p('register', { max: 10, //the number of items to return widget: 'default-widget', // name of widget opts: {maxAgeInSeconds: 86400}, callback: function(resp) { // You might wish to wrap the code in this callback inside jQuery, to handle load order issues //render the recommendations rendering_callback(resp); // track items in the recommendation area trackAlgo('LI'); } );
This will return only items that were published in the last 1 day (86400 seconds) according to their published_time value.
What should the Max Age be?
You can use any value as the maximum age, however we recommend keeping your rate of new content and the average lifespan of your content in mind when deciding on the time period. Also keep in mind that we will automatically privilege more recent articles slightly (again based on the "published_time" field value) so there should generally be more new content appearing in recommendations than older content.
New Content Rate
A good rule of thumb is the amount of time it would take to have 1000 new articles or items added to the site. This gives us a fairly broad range of items to recommend and should be sufficient to ensure there is enough content for any other filters or rules you have in place. So if you publish roughly 20 articles per day, a Max Age of 60 days should allow for varied and good quality recommendations.
Content Lifespan
If your content is more evergreen a time limit on content may not be necessary at all. We generally recommend using the "noShow" tag instead to block specific items that have a shorter shelf-life than your typical content. For example a movie review site might noShow an article about the 'best movies coming out in January' once January has passed, rather than using Max Age for all the recommendations.
For content that is heavily time-dependent, such as a news site, a very short Max Age of a single day may make more sense to block old stories that may become outdated very quickly by new updates.
Using Max Age
You can use the Max Age filter selectively, rather than in all widgets, to create more focused recommendation areas. We'll deduplicate items between widgets, so users won't see the same items in multiple areas.
Examples:
There may be a "Recommended For You" section and a "Recent Posts" section. We can power the recommendations in both of these areas - "Recent Posts" could be limited to the past few days' content, while "Recommended For You" is unfiltered.
On a news site, a "Breaking News" section might be limited to items published in the last 8 hours (this requires a high publishing rate to make sure we always have enough content that will meet this criteria!)
On an e-commerce site, a "New Items" section could be limited to items added in the past few days (items still use "published_time" - think of this field as representing when the item's page was published on your site).