This function calls RTP to check for matched real-time campaigns. If “autoRender” parameter is passed as true, then this function will automatically render the content in the designated DOM element.
You must become a Web Personalization customer and have the RTP tag deployed on your site prior to using the User Context API.
Parameter | Optional/Required | Type | Description |
‘get’ | Required | String | Method action. |
‘campaign’ | Required | String | Method name. |
autoRender | Optional | Boolean | Relative path or full page URL. |
callback | Optional | Function | Dynamic callback function. |
Examples
Automatically render content:
1 2 |
var autoRender = true; rtp('get', 'campaign', autoRender); |
Trigger a dynamic callback function:
1 2 3 4 |
function callbackFunction() { console.log('RTP is awesome!'); } rtp('get', 'campaign', callbackFunction); |