Creating Next best recommendation fields in Oracle Eloqua

To enable next best recommendations in Oracle Eloqua, you will need to create custom contact fields in Eloqua with specific field names that will be mapped to next best recommendation data in Oracle Unity.

You have the option of creating fields in the Eloqua platform or using Postman.

To create custom contact fields in Eloqua:

  1. Follow the steps for Creating contact fields in Eloqua.

  2. In the Display name input field, you'll need to define the label used in Oracle Unity for Next best recommendations and match it with an Eloqua contact field. Enter the exact name of the label for the next best offer or next best action (either with or without machine learning) in Oracle Unity.

    The table below displays the format of the labels for Next best recommendations. Each recommendation sent out will consist of these four columns. The "1" represents the ranking of the recommendation, with "1" being the highest ranking.

    Catalog ID Catalog name Recommendation ID Recommendation name
    rec_catalogid_1 rec_catalogname_1 rec_id_1 rec_name_1

    Note: You can create a maximum of ten recommendations: rec_catalogid_10, rec_catalogname_10, rec_id_10, rec_name_10.

  3. Configure the remaining parameters for each custom contact field.

    • Data type: Text

    • Field type: Textbox

    • Default Update Logic: Always update

    • Leave the remaining parameters blank or with the existing default value.

  4. Ensure the custom fields were added and available to view by Creating custom views.

Optional: Create contact fields using Postman

To create the contact fields using Postman:

  1. Copy the postman collection below.

  2. {
      "info": {
        "_postman_id": "790b3cdc-8ac2-451c-afcc-e9935784c15c",
        "name": "Eloqua",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
      },
      "item": [
        {
          "name": "Create contact rec attributes",
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "exec": [
                  "let c_attrs = pm.collectionVariables.get(\"rec_attrs\");",
                  "let totalNoOfRec = pm.collectionVariables.get(\"total_recommendation\");",
                  "",
                  "if(!c_attrs || c_attrs.length == 0) {",
                  "    c_attrs =[];",
                  "    for(let i=1;i<= totalNoOfRec;i++){",
                  "        let rec = ['rec_catalogid_','rec_catalogname_','rec_id_','rec_name_'];",
                  "        rec.forEach(element => {",
                  "            c_attrs.push(element.concat(i));",
                  "        })",
                  "    }",
                  "}",
                  "",
                  "let currentAttr = c_attrs.shift();",
                  "pm.collectionVariables.set(\"rec_attr\", currentAttr);",
                  "pm.collectionVariables.set(\"rec_attrs\", c_attrs);"
                ],
                "type": "text/javascript"
              }
            },
            {
              "listen": "test",
              "script": {
                "exec": [
                  "const c_attrs = pm.collectionVariables.get(\"rec_attrs\");",
                  "",
                  "if (c_attrs && c_attrs.length > 0){",
                  "    postman.setNextRequest(\"Create contact rec attributes\");",
                  "} else {",
                  "    postman.setNextRequest(null);",
                  "}",
                  "",
                  "pm.test(\"Status code is 201\", function () {",
                  "    pm.response.to.have.status(201);",
                  "});"
                ],
                "type": "text/javascript"
              }
            }
          ],
          "request": {
            "auth": {
              "type": "basic",
              "basic": [
                {
                  "key": "password",
                  "value": "{{password}}",
                  "type": "string"
                },
                {
                  "key": "username",
                  "value": "{{username}}",
                  "type": "string"
                }
              ]
            },
            "method": "POST",
            "header": [
              {
                "key": "X-HTTP-Method-Override",
                "value": "SEARCH",
                "type": "text",
                "disabled": true
              },
              {
                "key": "Content-Type",
                "value": "application/json",
                "type": "text"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n    \"name\": \"{{rec_attr}}\",\n    \"dataType\": \"text\",\n    \"displayType\": \"text\",\n    \"updateType\": \"always\"\n}"
            },
            "url": {
              "raw": "{{eloqua_url}}/api/REST/1.0/assets/contact/field",
              "host": [
                "{{eloqua_url}}"
              ],
              "path": [
                "api",
                "REST",
                "1.0",
                "assets",
                "contact",
                "field"
              ]
            }
          },
          "response": [
            
          ]
        }
      ],
      "event": [
        {
          "listen": "prerequest",
          "script": {
            "type": "text/javascript",
            "exec": [
              ""
            ]
          }
        },
        {
          "listen": "test",
          "script": {
            "type": "text/javascript",
            "exec": [
              ""
            ]
          }
        }
      ],
      "variable": [
        {
          "key": "total_recommendation",
          "value": "10"
        },
        {
          "key": "username",
          "value": ""
        },
        {
          "key": "password",
          "value": ""
        },
        {
          "key": "eloqua_url",
          "value": ""
        }
      ]
    }
  3. Import the postman collection into Postman.

  4. Click the collection name, then click Variables.

  5. An image of the Variables section

  6. For the variables username, password, and eloqua_url, enter your Eloqua instance URL and login credentials for the CURRENT VALUE column.

  7. An image of the username, password, and eloqua_url variables

  8. For the variable total_recommendation, enter a value for CURRENT VALUE that represents the number of recommendations you want created (a value from 1 to 10).

  9. An image of the Current Value section
  10. While still in the same collection, execute the API by clicking Run.

  11. An image of the Run button

  12. After running successfully, you should see the following response.

  13. An image of the successful response after running the API

Next steps

Configuring an Oracle Eloqua destination for Next best recommendations

analytics, recommendations, offers, actions, nba, nbo, next best offers, next best actions, create offer, create action