This guide walks you through the entire process of setting up Recombee on your Drupal site using the Recombee module and the Search API Recombee module. From installation and configuration to creating personalized recommendation scenarios, you'll gain all the tools and knowledge needed to transform your Drupal site into a platform that resonates with every visitor. Whether you're an experienced Drupal developer or setting up Recombee for the first time, this guide ensures a seamless integration process.
For seamless integration into your Drupal site, you can use the Recombee module along with the Search API Recombee module. Together, these modules allow you to leverage Recombee’s API and enhance your Drupal site’s search and recommendation capabilities. In this guide, we’ll walk you through integrating Recombee in your Drupal site using these two modules.
See it in action
Before we jump into setting up Recombee, it will be helpful to see how Recombee is operating in the wild. The Recombee site provides an example content recommendation site.
A similar site has been built with Drupal. The GovFlix proof of concept site showcases how Recombee can be integrated. The site provides several scenarios including:
- Top picks
- Trending now
- Recently viewed
- Recently added
- Related items
- Search
Prerequisites
Before you begin, ensure you have:
- A Drupal website up and running.
- A Recombee account: Sign up at Recombee.
- Your Recombee API key and database name.
- Basic understanding of the Search API module in Drupal.
Step 1: Install the required modules
- Download and install the modules
composer require drupal/search_api_recombee drupal/recombee
- Enable the modules via the Extend page in the admin dashboard or with Drush
- If there are any dependencies, Drupal will also request to install them on the confirmation screen.
Step 2: Configure the Recombee module
1. Access Recombee Settings
Navigate to Configuration > Web services > Recombee Settings
2. Provide API credentials
Define the website's Site ID and base URL and provide the API Credentials after taking them from the Recombee dashboard.
Click Save configuration to connect your Drupal site to Recombee.
Step 3: Configure Search API with Recombee
The Search API Recombee module allows you to integrate Recombee as a backend for the Drupal Search API.
1. Set Up a Search API Server
- Go to Configuration > Search and Metadata > Search API.
- Click Add Server to create a new Search API server.
- Configure the server as follows:
- Name: Provide a meaningful name (e.g., Recombee).
- Backend: Select Recombee.
- Enter the Recombee Private API key, database name, and region after taking them from the Recombee dashboard.
Click Save to create the server.
2. Set Up a Search API index
- Under the Search API configuration, click Add index.
- Configure the index:
- Name: Provide a name (e.g., Recombee Content).
- Server: Select the Recombee server created earlier.
- Data sources: Choose the entity type to index (e.g., content, comment, or media). Configure the respective bundles of these entity types.
- Configure the index options, or leave them as default.
Click Save and continue to proceed.
3. Add fields to the Recombee Index
Click Save Changes to proceed.
Now, index the content in the Recombee index. Verify that the content populated in Recombee dashboard
Step 4: Enable event tracking for recommendations
The Recombee module includes a Tracker block that automatically logs user activities. Go to Administration > Structure > Block Layout to place the block.
Configure the block and place it in the Content Region
Now, visit the website as an anonymous user and the site will start tracking the anonymous users on the website and build their anonymous profile in the Recombee dashboard.
Step 5: Display Recommendations on your site
Go to Recombee Dashboard and create the recommendation scenarios there by going to
Dashboard > Click on Scenarios under Recommendations in the left navigation
For example, let's show the similar published articles to the user which it has visited, so I’ll configure the item_items_similar Scenario and add the filter to only show published articles.
Now, go back to the Drupal website. The Recombee module provides the Recombee Public Scenario block which shows the items from the Recombee on the website. Now, Place the block for anonymous users by going to
Administration > Structure > Block Layout
Step 6: Test and optimize
- Test Recommendations: Verify the functionality of your Search API index and blocks displaying recommendations by visiting as an anonymous user.
- Monitor Performance: Use the Recombee dashboard to analyze engagement metrics.
- Optimize Settings: Refine mappings, adjust tracking configurations, and fine-tune filters to improve recommendations.
Conclusion
By combining the Recombee and Search API Recombee modules, you can create a powerful recommendation system within your Drupal site. This integration enables you to deliver tailored content and enhance user experiences, making your site more engaging and effective.
Have you tried integrating Recombee into your Drupal site? Share your thoughts and experiences in the comments below!
Morpht has developed both the Recombee and Search API Recombee modules and is available for consultation and integration work.