Adds the capability to trigger functions on certain state of the global rtp object.
You must become a Web Personalization customer and have the RTP tag deployed on your site prior to using the User Context API.
Usage
rtp(‘triggerName’, function_to_trigger);
Parameter | Optional/Required | Type | Description |
‘triggerName’ | Required | String | Method name. |
function_to_trigger | Required | Function | Function to trigger. |
User Context Ready Trigger
Sets a custom variable based on user location. This function will be called when the “rtpUserContext” global object is ready.
1 2 3 4 5 |
rtp('userContextReady', function() { if (rtpUserContext.location.state == 'CA') { rtp('set', 'custom1', 'productA'); } }); |