Tutorial: Real time Product Recommendations with Adobe Target

Adobe Target Premium can be used for sophisticated product or content recommendations. Building on the last post, we are going to build our very own recommendation engine based on user behavior in real time. I assume you’ve read that post, but feel free to go back and read it first!

Starting with recommendations

As we know from the last blog post, Adobe Target is well equipped to personalize content in real time. To do this, we sent information about the products and users to Target in mbox requests. Now we are going to use the same concept to give real product recommendations!

To get started, we need to understand a few basic concepts. First, Target must know about your products. We can either give details with the mbox requests or upload them in different types of feeds. What we end up with is a catalog of products with some information. For our purposes, it looks like this:

Target is very flexible with that catalog. Look at the third product from the screenshot to see a product with more than one category, which Target handles just fine. Next up is the concept of Criteria, which determine how recommendations should be given. Target has over 40 builtin algorithms and even lets you define your own! This is a sample:

The last thing we need to get started is the concept of Designs. A design determines what is returned in the mbox call. There are some presets for HTML content, but you are completely free in creating your own HTML, JSON, or just any format you like. This is where you define placeholders from the product catalog or even the user. This should look familiar from the previous post:

Our first recommendation engine

To get started, send some product information to Target via mbox calls. You can use a call like this to create a product in the catalog:

adobe.target.getOffer({
  "mbox": "DemoBox2",
  "params":{
     "entity.id":"product_1",
     "entity.categoryId":"category_1",
     "entity.name":"My Awesome Product 1",
     "entity.message":"One of our best products!"
  },
  "success": function(offer) {
    console.log("Result: "+JSON.stringify(offer));
  },
  "error": function(status, error) {
    console.log('Error', status, error);
  }
});

The next step is to create a Design. We don’t need any nice styling for our exploration, so let’s create a simple JSON Design. Head over to the Recommendations section in Target and create a new Design with code like this:

 {   
     "adobeRecommendations": {   
      "recommendedItems": {   
       "slot-01": "$entity1.id",   
       "slot-02": "$entity2.id",   
       "slot-03": "$entity3.id",   
       "slot-04": "$entity4.id",   
       "slot-05": "$entity5.id",   
       "slot-06": "$entity6.id",   
       "slot-07": "$entity7.id",   
       "slot-08": "$entity8.id",   
       "slot-09": "$entity9.id",   
       "slot-10": "$entity10.id"   
      },   
      "recDetailedResults": {   
       "recEntity1Details": {   
        "id": "$entity1.id",   
        "name": "$entity1.name",
        "message": "$entity1.message"
       },   
       "recEntity2Details": {   
        "id": "$entity2.id",   
        "name": "$entity2.name",
        "message": "$entity2.message"
       },   
       ...  
      }   
     }   
    }  

That’s it! Now we only need to create an Activity, referencing our DemoBox2 and our Demo Design. Let’s start with a simple Recommendation Algorithm, that only shows the last viewed articles in an Activity like this:

Tracking Activity and giving recommendations

Now, switch over to your browser console and see what Target does if we request the recommendation right now. Use a script like this:

adobe.target.getOffer({
  "mbox": "DemoBox2",
  "success": function(offer) {
    console.log("Result: "+offer[0].content);
  },
  "error": function(status, error) {
    console.log('Error', status, error);
  }
});

Target should not return anything right now:

This is because we don’t have any recently viewed products right now. So let’s generate some product views like before:

adobe.target.getOffer({
  "mbox": "DemoBox2",
    "params":{
     "entity.id":"product_1"
  },
  "success": function(offer) {
    console.log("Result: "+offer[0].content);
  },
  "error": function(status, error) {
    console.log('Error', status, error);
  }
});

This adds the product views to the visitor profile. Now, let’s request our recommendations again like this:

adobe.target.getOffer({
  "mbox": "DemoBox2",
  "success": function(offer) {
    console.log("Result: "+offer[0].content);
  },
  "error": function(status, error) {
    console.log('Error', status, error);
  }
});

Now we actually get something back, according to our Design:

It worked! We get one result since we viewed one product. When we repeat the steps above with different products, we get more and more recommendations back each time.

Giving meaningful recommendations to engage users

This is only the start if you want to get serious with recommendations. Target has a ton of recommendation algorithms that you can tailor to your business needs. For example, we could combine the user’s favorite product with a Criteria that takes that product and recommends similar products based on the catalog, but excludes already purchased ones. Target can do that!

Target gives us powerful tools to engage with our users. All recommendations can also be part of an A/B test, so we can find out which one works best for our users. Combine with Adobe Analytics through A4T for bonus points!

Frequently asked questions

What is Adobe Target?

Adobe Target is Adobe’s solution that is know best for A/B testing of digital experience. But it can do much more, like real-time personalization and dynamic recommendations. With the connection to Adobe Analytics, we can create hyper-targeted experience in a user friendly interface.

How can I use Adobe Target for recommendations?

It’s quite easy! After you brought your product data into Adobe Target, you can create a recommendation experience that works like any other activity in Target. You can tailor the content to be rendered into the user’s browser or to be consumed by an API.