Integration: Channels
To enable reporting by channel (e.g. tablet, mobile, web), you will need to provide Algonomy with a client API key. This key ties traffic to a specific channel. Please consult with your Algonomy contact to determine the client API key to pass and to have this key configured for your account.
JavaScript Integration
How To Make This Code Work For You
- Create the integration code on each of the pages on your site, following the HTML integration and JSON integration guides.
- Add this function to your integration code:
Function | Requirement |
---|---|
R3_COMMON.setChannel('CHANNEL_ID'); |
Replace CHANNEL_ID with the client API key defined for the channel. (Get the API key from your Algonomy team.) |
Sample Code
Call setChannel()
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.setChannel('b0126f995'); rr_flush_onload(); r3(); </script>
APIs
Set the channel ID with the apiClientKey
parameter in recsForPlacements.
Example: apiClientKey=b0126f995ac848159d