Audience Stream: enrich an attribute after 15sec on a page

Bronze Contributor
Bronze Contributor

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 

1 REPLY 1

Audience Stream: enrich an attribute after 15sec on a page

Tealium Employee

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

Jen Kaye
Senior Customer Success Engineer | Tealium, Inc.
Public