Edit in GitHubLog an issue

Manage Custom Criteria

Sometimes the algorithms provided by Recommendations are not able to surface particular items you would like to promote. In such a situation, custom criteria provide a way for you to deliver a specific set of recommended items for a given key item or category. You define the mapping between the key item or category and the recommended items, and import that mapping as a custom criteria. This process is described in the custom criteria documentation. As noted in that documentation, you are able to create, edit, and delete custom criteria through the Target user interface (UI). However, Target also provides a set of Custom Criteria APIs that allow for more detailed management of your custom criteria.

Create Custom Criteria#

To create custom criteria using the Create Custom Criteria API, the syntax is:

POST https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom

Only proceed with this tutorial after you have read the warning above and are comfortable creating new custom criteria that cannot subsequently be deleted from the UI.

  1. Verify TENANT_ID and API_KEY for Create custom criteria reference the Postman environment variables established earlier. Use the image below for comparison.


  2. Add your Body as raw JSON that defines the location of your custom criteria CSV file. Use the example provided in the Create Custom Criteria API documentation as a template, supplying your environmentId and other values as necessary. For this example, we use LAST_PURCHASED as the key.


  3. Send the request and observe the response, which contains the details of the custom criteria you just created.


  4. To verify your custom criteria has been created, navigate within Adobe Target to Recommendations > Criteria and search for your criteria by name, or use the List Custom Criteria API in the next step.


In this case, we have an error. Let's investigate the error by examining the custom criteria more closely, using the List Custom Criteria API.

List Custom Criteria#

To retrieve a list of all your custom criteria along with details for each, use the List Custom Criteria API. The syntax is:

GET https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom

  1. Verify TENANT_ID and API_KEY as before, and send the request. In the response, note the custom criteria ID, as well as details regarding the error message noted earlier. ListCustomCriteria

In this case, the error occurred because the server information is incorrect, meaning Target is unable to access the CSV file containing the custom criteria definition. Let's edit the custom criteria to correct this.

Edit Custom Criteria#

To change the details of a custom criteria definition, use the Edit Custom Criteria API. The syntax is:

POST https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom/:criteriaId

  1. Verify TENANT_ID and API_KEY, as before. EditCustomCriteria1

  2. Specify the criteria ID of the (single) custom criteria you would like to edit. EditCustomCriteria2

  3. In the Body, supply updated JSON with the correct server information. (For this step, specify FTP access to a server you can access.) EditCustomCriteria3

  4. Send the request and note the response. EditCustomCriteria4

Let's verify the success of the updated custom criteria, using the Get Custom Criteria API.

Get Custom Criteria#

To view custom criteria details for a specific custom criteria, use the Get Custom Criteria API. The syntax is:

GET https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom/:criteriaId

  1. Specify the criteria ID of the custom criteria whose details you would like to get. Send the request, and review the response. GetCustomCriteria.png
  2. Verify success. (In our case, verify there are no further FTP errors.) GetCustomCriteria1.png
  3. (Optional) Verify the update reflects accurately in the UI. GetCustomCriteria2.png

Delete Custom Criteria#

Using the criteria ID noted earlier, delete your custom criteria, using the Delete Custom Criteria API. The syntax is:

DELETE https://mc.adobe.io/{{TENANT_ID}}/target/recs/criteria/custom/:criteriaId

  1. Specify the criteria ID of the (single) custom criteria you would like to delete. Click Send. DeleteCustomCriteria1

  2. Verify the criteria has been deleted using Get Custom Criteria. DeleteCustomCriteria2 In this case, the expected 404 error indicates the deleted criteria cannot be found.

Congratulations! You are now able to create, list, edit, delete, and get details on custom criteria, using the Recommendations API. In the next section, you will use the Target Delivery API to retrieve recommendations.

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell my personal information
  • AdChoices
Copyright © 2022 Adobe. All rights reserved.