Skip to main content
RichRelevance

Click-Through Parameters

Appending Additional Values to Product URLs

You can add parameters to the links used when a shopper clicks on a recommendation. Querystring parameters fall into two main categories: static and dynamic.

Static

Static querystring parameters will be consistent in all renderings of the layout and do not need the key or value to be supplied by the integration code. Static values will be set up by your RR technical contact. 

The landing page URL might look like this, where campaign=rr is a unchanging value for all recommendations:

http://yourstore.com/product/1234?campaign=rr

Dynamic

Dynamic parameters are values that can differ from one recommendation set to another, and require a little coordination with your RR technical contact and front end development team. The code changes required in the site integration is to include an addClickthruParams() call specifiying the index to append at and the exact value to append.

JavaScript Integration

How To Make This Code Work For You

Add the following lines of code to your page tags, adding the required information to them:

Function Requirement
R3_COMMON.addClickthruParams(Index,'String'); Replace Index with the index for the querystring parameter; in other words, in what order it should appear in the URL. Replace String with the parameter string you need inserted. This should be in the format "key=value" (i.e. "country=china")

Sample Code

Call addClickthruParams() in the Primary Code Block.

Primary Code Block

<!-- 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 no user ID is available, please leave this blank

  // Use this code if you are not requesting placement(s) for personalization
  R3_COMMON.addPlacementType('home_page');

  // Replace placement_name with the placement name you set up in Dashboard.
  // Call multiple times to display more than one placement.
  R3_COMMON.addPlacementType('home_page.placement_name');
  
  // Set the first parameter in the querystring to "campaign=RR"
  R3_COMMON.addClickthruParams(0, 'campaign=RR’);
 
  var R3_HOME = new r3_home();
  rr_flush_onload();
  r3();
</script>