What are Content Recommendations?
If you have Netflix, you’re probably familiar with the idea of recommended content. When you log in, Netflix will suggest new movies or TV shows based on what you’ve already watched and the genres you like.
Similarly, Lytics Content Recommendations seek to provide a unique, personalized experience for each user based on their affinity data. It’s pretty simple: Serve your users content that matches their interests and they’re more likely to click it and continue engaging with your brand.
Lytics Content Affinity
If you’re not already familiar with Lytics’ Content Affinity Engine, here’s a quick run down: Our engine can crawl your website to build up an inventory of your content. During this process, we extract topics from each page using text analysis, and we also measure individual user engagement with each piece of content over time. We then translate this engagement data into user affinities, with a score from 0 to 1 measuring how interested a user is in a topic.
This is some pretty detailed data. Alone it provides great insight into your users’ interests, but it becomes even more valuable when you can start using it for truly one-to-one marketing.
How does it work?
Using the inventory of content Lytics has built up, we can recommend content to your users when they visit your website. Our Content Recommendation API accepts an identifier for the user and returns a number of suggested documents based on that user’s affinities. We’ve built this into our Personalization SDK to make it accessible for use on your website. So if you’re a developer, adding recommendations seamlessly into your website is extremely simple.
Sounds cool, right? Let’s see it!
We use inline recommendations right here, on the Lytics blog. At the bottom of this blog post are several articles from our own blog that we recommend for you based on your affinities in Lytics. If you don’t want to scroll all the way down yet, they look something like this:
Implementing inline Content Recommendations
Here are the three data attributes we will be using:
- data-pfblock – unique identifier for a single recommendation block.
- data-pfrecommend – ID or alias of a content collection (a segment on the Lytics content table) to filter documents.
- data-pftype – the value of this attribute determines which field of the recommended document is associated with the element such as title, url, etc.
For more detailed documentation on these attributes and additional HTML examples, check out our developer docs on inline content recommendations.
Before you can use inline content recommendations, you’ll need to build at least one content collection.
curl -s -XPOST “https://api.lytics.io/api/segment”
-H “Content-type: text/plain”
-H “Authorization: $LIOKEY”
FILTER AND (
global CONTAINS “developers”
path CONTAINS “blog/post”
‘ | jq ‘.’
Check out our segment API docs for more info on how to create, scan, or update segments and how to construct segment definitions with SegmentQL.
Now that we’ve built a content collection, we can use it as a filter for our recommendations. This is important because there’s rarely a time where you’d want to recommend any piece of content on your website. For example, even if it matches their interests, you wouldn’t want to recommend that someone visit your Careers or About page in a marketing context.
Alright, now that we have all the pieces, let’s put it all together. You’re going to have one wrapper element with the pfblock and pfrecommend attributes for each recommendation and then several inner elements with the pftypeattribute and values url, title, and description. We can also optionally include the image, author, or published date.
As mentioned earlier, Pathfora will detect these elements and fill in the recommended document fields accordingly. Also keep in mind that adding multiple recommendation blocks that use the same content collection (same pf-recommend value) will pull recommendations from a single API call in the order that they were returned. Thus we can assure that no article will be repeated across recommendations on the same page.
That’s really all there is to it! Remember to check out our full developer documentation around inline recommendations. If you’re an existing customer and would like to try this out, reach out to our customer success team if you need assistance. If you’re new to Lytics and the idea of content recommendations interests you, reach out to our sales team to request a demo.