Skip to main content

Content Personalisation

Content Personalisation in Drupal

Tailor your websites content to your customer to give them a great user experience

Many organisations wish to offer personalised content and services to their users, with the possible solutions ranging from simple to complex and very expensive. In our experience, there’s definitely no one-size-fits-all approach that is applicable to all clients, so we try and ensure we match the solution that provides the highest business value.

A key consideration when offer personalised content is context, which may include:

  • User is logged in or anonymous
  • User belongs to a role
  • What part of the site the user is in
  • Time of day, day of week
  • User selected preferences, e.g. topics they have chosen in their profile
  • Using a mobile device, tablet or at a desktop
  • Past event registration
  • Past order history if on a shopping site
  • Past articles viewed


The most simple personalisation can be handled using Drupal 8’s built in condition API. You can create two blocks with different content, and switch them out based on their visibility rules (e.g. show this block for anonymous users, this other one for logged in users). This also applies to user roles, so for example, you can display a block with the current logged in users for a site administrator.

Extending Conditions

The Condition API is extensible with plugins. That means with a little custom code, you can create your own custom conditions for showing or hiding content.

This could be done, for example with a Time of Day condition, or Day of the week condition.

Matching Categories

Taking it one step further, if you can utilise a common taxonomy for both user preferences, and content, you can make a simple condition that can match the right content with the right user. For example, if the content is tagged with ‘power tools’ and the user has selected they like ‘power tools’ in their profile, we can simply display content that matches their ‘liked’ categories. This can evolve over time to provide highly contextual personalised content.

Matching Multiple Conditions

When you start to need to match on multiple conditions, you may be faced with the problem of fragmentation. That is, trying to match the right content will be too specific and you may not have enough content to satisfy all the possible combinations.

This is where some tools come into play which let you do some experiments and see what works and what doesn’t.

In Drupal 7 you can use the Personalize module. This abstracts out the process of personalisation into the key components:

  • Campaigns: A way to group together a personalisation feature
  • Decision agents: Makes the choice of what to show based on a number of factors provided by user contexts
  • Option sets: You provide the choices for which content can be displayed
  • Visitor context: All the different bits of information that can be used to make a decision by a decision agent

Essentially, the Personalize module renders all options to the page initially hidden, then uses javascript to show the right one based off the decision agent.

Machine Learning

What happens when you have so much user context, and so much content metadata that it’s impossible to make decisions about what to display? This is where machine learning can help.

A an example batch analysis workflow is:

  • Extract all known metadata for your users and content into a standard text format (e.g. CSV) or cloud nosql database storage service (e.g. Amazon Dynamo DB)
  • Provide the machine learning service with a small set of training data (e.g for these users, assign these category preferences)
  • Run your extracted metadata through the machine learning service to have it provide the best guess category preferences for users and update your database
  • Import the user preferences back into the site

The machine learning service has given you the best guess at what the user preferences are, so you can go back to the simple process of matching user category preferences with content. Alternatively, you can plug the results into the Personalize module, providing an alternative to a proprietary service like Acquia Lift.

You can take this one step further by calling the analysis service on a regular basis. Typically this is a more complex approach, and the costs become higher.

Before you spend tens of thousands of dollars on a hosted personalisation service for your Drupal site, we’d recommend you start by looking at what you can do with existing Drupal modules and cutting edge cloud services.

Please contact the PreviousNext team if you'd like to find out more about this solution.

Related case Studies

Amaysim thumbnail image


Australia’s fourth largest mobile service provider, amaysim, required a new website that would allow the scope to keep up with the company’s growth and agility both now and into the future. In early 2016, PreviousNext were engaged for the development of this new site on the Drupal content management system.

Medical Observer thumbnail image

Cirrus Media

In early 2015, the healthcare division of Cirrus Media engaged PreviousNext for the redevelopment of their Medical Observer website on a Drupal platform.

Homeheaven thumbnail image


With a vision to create an online "Neighbourhood of knowledge" that brings together practical, informative, and inspirational content, Directories Group, turned to PreviousNext for the user experience design and Drupal development of their newest site,