Last week we launched Content Recommendations in our Web Personalization tool. If you’re a developer, you may be excited to learn that we also offer inline content recommendations that can be implemented with basic HTML. Lets walk through an introduction to Lytics content recommendations and this simple developer use case.
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 their more likely to click it and continue engaging with your brand.
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 - a score from 0 to 1 measuring how interested a user is in a topic.
This is some pretty detailed data. Alone it provides some great insight into your users’ interests, but it becomes even more valuable when you can start using it for truly one-to-one marketing.
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 recommmendations seemlessly into your website is extremely simple.
We use inline recommendations right here, on the Lytics blog. Check it out, below are two articles from our own blog that we recommend for you based on your affinities in Lytics:
But hey! don’t click away just yet, next up we’re going to walk through how to implement this on your own site.
Here’s the three data attributes we will be using:
For more detailed documentation on these attributes and an additional HTML examples, check out our developer docs on inline content recommendations.
Let’s take a second to talk about content collections, as they’re a fairly new feature in Lytics, and you’ll need to build at least one to use inline content recommendations.
export LIOKEY=[YOUR LYTICS API KEY] curl -s -XPOST "https://api.lytics.io/api/segment" \ -H "Content-type: text/plain" \ -H "Authorization: $LIOKEY" \ -d ' FILTER AND ( global CONTAINS "developers" path CONTAINS "blog/post" ) FROM content ALIAS developer_blog_posts ' | jq '.'
Check out our segment API docs for more info on how to create, scan, or update segments and how to construct segment definititions 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.
<div data-pfblock="dev_recommendation" data-pfrecommend="developer_blog_posts"> <img data-pftype="image" alt="recommendation image"> <h2 data-pftype="title"></h2> <p data-pftype="description"></p> <p><a data-pftype="url">Read More...</a> </div>
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 accross 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, feel free to 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, feel free to reach out to our sales team to request a demo.