Skip to main content
RichRelevance

Blocked Items

This option forces Recommend to NOT recommend specified products. It is most commonly used when there are products already being displayed on the page that you do not want duplicated in the RichRelevance recommendations.

This can be called more than once if you have several products to be suppressed.

JavaScript Integration

How To Make This Code Work For You

  1. Create the integration code on each of the pages on your site, following the HTML integration and JSON integration guides.
  2. Add this function to your integration code:
Function Requirement
R3_COMMON.blockItemId('PRODUCT_ID'); Replace PRODUCT_ID with the product ID of the product you don’t want to recommend. CallblockItemId() for each product you don’t want to show.

Sample Code

Call setForcedTreatment() in the Primary Code Block.

HTML

<!-- Place this code inside the <body> element as close to the top as possible -->
<script src="//media.richrelevance.com/rrserver/js/1.0/p13n.js"></script>
<script charset="utf-8" type="text/javascript">
  var R3_COMMON = new r3_common();
  R3_COMMON.setApiKey('abcd5432e1');
  R3_COMMON.setBaseUrl(window.location.protocol+'//integration.richrelevance.com/rrserver/');
  R3_COMMON.setClickthruServer(window.location.protocol+"//"+window.location.host);
  R3_COMMON.setSessionId('6B4D397B');
  R3_COMMON.setUserId('1');  // if exists, set it; if not, set it as session ID
  
  // here's an example requesting recommendations for 1 page area
  R3_COMMON.addPlacementType('home_page.rr1');
    
  var R3_HOME = new r3_home();
 
  R3_COMMON.blockItemId('ST305869');
 
  r3();
  
</script>

JSON

<!-- Place this code inside the <body> element as close to the top as possible -->
<script charset="utf-8" type="text/javascript">
  var R3_COMMON = new r3_common();
  R3_COMMON.setApiKey('abcd5432e1');
  R3_COMMON.setBaseUrl(window.location.protocol+'//integration.richrelevance.com/rrserver/');
  R3_COMMON.setClickthruServer(window.location.protocol+"//"+window.location.host);
  R3_COMMON.setSessionId('6B4D397B');
  R3_COMMON.setUserId('10987');  // if exists, set it; if not, set it as session ID
  
  // here's an example requesting recommendations for 1 page area
  R3_COMMON.addPlacementType('home_page.rr1');
 
  var R3_HOME = new r3_home();
 
  R3_COMMON.blockItemId('ST305869');
 
  rr_flush_onload();
  
  r3();
</script>