Skip to main content
RichRelevance

Integration: Page Information

Page-level information can be added to the Algonomy feed through the highly customizable pageAttribute.

New keys for pageAttribute are in development for multiple features. Currently, retailerPageType is the only available key.

retailerPageType

The retailerPageType key lets you associate retailer-specific page types with data in the {rr} feed. 

To use retailer-specific page types, you need to instrument each page type according to {rr} guidance, as well as create a container designated for {rr} rendered content. {rr} will supply the corresponding placement ID.

Here’s the recommended placement naming format:

[{rr} page type].[client pagetype]_[client placement type]_[placement count]

In addition, to facilitate reporting, you’ll need to include in the instrumentation for each page type additional context to explicitly identify the page type label. 

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.addContext({
"pageAttribute":{ "retailerPageType": “YOUR_PAGE_TYPE” }
});
ReplaceYOUR_PAGE_TYPEwith your site’s page type name.

Sample Code

Call addContext() in the Primary Code Block.

JSON

<!-- Place 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.addContext({
     "pageAttribute":{ "retailerPageType": “Daily Deals” }
  });
 
  rr_flush_onload();
  
  r3();
</script>

APIs

Page attributes are not supported via API.

  • Was this article helpful?