Triggers
Last update: June 5, 2024
- Topics:
- Javascript
CREATED FOR:
- Admin
Adds the capability to trigger functions on certain state of the global rtp object.
You must be a Web Personalization customer and have the RTP tag deployed on your site before 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 is called when the “rtpUserContext” global object is ready.
rtp('userContextReady', function() {
if (rtpUserContext.location.state == 'CA') {
rtp('set', 'custom1', 'productA');
}
});
Previous pageSocial
Next pageWeb Personalization
Marketo Engage
- Home
- Getting Started
- Javascript API
- Mobile
- REST
- SOAP
- Webhooks
- Client Libraries
- Data Streams
- Email Scripting
- License
- Partner Sandbox
- Self-Service Flow Steps
- Blog Archive