- TLC Home Home
- Discussions Discussions
- Documentation Documentation
- Knowledge Base Knowledge Base
- Education Education
- Blog Blog
- Support Desk Support Desk
05-17-2022 08:23 AM
Hello everybody,
I need to fire a popup after an user has been for at least 15 seconds on a page, whatever page
I use an attribute enrichment to trigger the popup to show, my problem is how to count 15sec since the user land on a page, but before he goes to another page. It would be easily calculate using 'current url' / 'referring url' witha ssociated timestamp, but this method would give me the time on page AFTER the user has changed page, while what I need is to calculate the time on page threshold while the user is still on the page.
Any ideas?
Thank you
07-12-2022 04:07 PM - edited 07-19-2022 12:05 PM
Hi there! If you want to set code to fire after 15 seconds, you can use a JavaScript code extension set to DOM Ready with the following code, you can set the popup to trigger within the "triggerModal" function:
var myTimeout = setTimeout(triggerModal, 15000);
function triggerModal() {
<<TRIGGER POPUP HERE>>
}
I hope this helps achieve your desired results.
Thanks,
Jen
Copyright All Rights Reserved © 2008-2023