Server-side recommendation deduplication

When a Choose API request includes multiple recommendation selectors, the same product might be returned by more than one selector. Server-side recommendation deduplication prevents duplicate products from appearing across recommendation results without requiring custom deduplication logic.

How it works

In your Choose API request, under options, set the deduplicateRecommendations parameter to true:

{
  "deduplicateRecommendations": true
}

See full request example that follows for more information

When deduplication is enabled:

  • Each SKU can appear only once across the entire response.
  • Selector order is preserved when sent as an array.
  • If the same SKU appears in multiple selectors, it's kept in the first selector where it appears and removed from subsequent selectors.
🚧

Selector array vs. group

When selectors are sent as an array, selector order determines priority during deduplication. When using selector groups, deduplication is supported, but selector priority is random. To control which widget retains duplicate products, send selectors as an array.

Example

Without deduplication:

Selector A: SKU1, SKU2, SKU3
Selector B: SKU1, SKU3, SKU4

With deduplication enabled:

Selector A: SKU1, SKU2, SKU3
Selector B: SKU4, SKU5, SKU6
Full request example
{
  "user": {
    "dyid": "7539026014230433393",
    "dyid_server": "7539026014230433393"
  },
  "session": {
    "dy": "wpq83hsu75qeirkygjroub0ow84tyqlt"
  },
  "context": {
    "channel": "Web",
    "page": {
      "type": "PRODUCT",
      "data": [
        "0438714516010"
      ],
      "location": "www.company.com/products"
    },
    "device": {
      "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36",
      "ip": "104.156.90.59"
    },
    "pageAttributes": {
      "LoyaltyStatus": "NONCARDHOLDER"
    }
  },
  "selector": {
    "names": [
      "pdp-recommendations",
      "similar-products"
    ]
  },
  "options": {
    "isImplicitPageview": false,
    "returnAnalyticsMetadata": false,
    "isImplicitImpressionMode": true,
    "isImplicitClientData": false,
    "deduplicateRecommendations": true,
    "recsProductData": {
      "fieldFilter": [
        "brand",
        "group_id",
        "image_url",
        "name",
        "url"
      ]
    }
  }
}

Limitations

Deduplication is supported for requests containing up to 10 selectors.

If a request contains more than 10 selectors:

  • The request is processed normally.
  • No deduplication is performed.
  • The deduplicateRecommendations parameter is ignored.
  • The API response includes the following warning:
{
  "warnings": [
    {
      "message": "Deduplication is only supported for up to 10 selectors. The parameter was ignored for this request."
    }
  ]
}

Recommended use cases

Use server-side recommendation deduplication when multiple recommendation selectors might return the same products, such as:

  • Multiple recommendation widgets on the same page
  • Product detail pages
  • Homepage recommendation sections
  • Any server-side implementation where duplicate products should be avoided across widgets

Did this page help you?