This custom Javascript allows RTP users to show campaigns a few seconds after the web page loads. This is recommended for dialog box and widget campaigns. It can be used to show a campaign after a delay, once the visitor viewed the regular content on the page.
Implement this code only on specific pages where the campaign/s should be displayed. Using this code across all pages is not recommended as it may affect performance.
Instructions:
The custom code sends an RTP Custom Data Event (t=timeOnPage, i.e: t=60) and then loads the campaign that matches this event. By default, it will be triggered after 60 seconds. You can customize it by changing the sendCustomRTPEvent parameter to any other number.
Place the code right after the standard RTP code:
<script>
function sendCustomRTPEvent(a){
eventValue="t="+a;
setTimeout(function(){
rtp('send', 'event', {value: eventValue});
rtp('get', 'campaign',true);
}, 1000 * a);
}
sendCustomRTPEvent(60); //Seconds
</script>
See this code also on: http://jsfiddle.net/1r08j3ga/
To setup a RTP campaign to react after a time delay:
Login to your RTP account
Create a new segment
In the Segment Events section add: ‘t=60’
Note: a visitor can only match each RTP segment once per session, therefore seeing each campaign only once.
Hi @Yanir
I have done the same but my campaign still shows up on the page load. I want to show the campaign after 30 seconds
Thanks
We provide an out of the box feature for Dialog Campaigns to delay the campaign by a defined number of seconds.
See Create a New RTP Dialog Web Campaign - Marketo Docs - Product Docs - Display On and Delay
Yes, the feature is added for Dialog campaigns but not for widgets. Any plans to add the same feature for widgets too. We tried using the JS as mentioned by Yanir Calisar but it did not work.
Yes, we plan to add delays for widgets soon, hopefully by Summer release 2017.