Track time on site
Get the most out of your digital marketing campaigns with AnyTrack.io's Track Time on Site feature in the Custom Conversions category. Now you can accurately track user engagement and optimize your ROAS!
The time a visitor spends on your can give you a good indication of your content's value or the quality of your traffic.
Before you begin:
You must be familiar with Javascript, HTML, and CSS to use these tracking snippets. If you're not familiar with all of these coding languages, please forward the article to a developer.
The SetTimeOut function
To trigger a "time on site" Event you can use the function: setTimeout
This Event accepts an Event Name as well as a an encoded time value.
The snippet below
setTimeout(function() {
//Replace LongVisit with any other event name
AnyTrack("trigger", "LongVisit");
//10 seconds is encoded
}, 10e3);
This code will trigger an event name called LongVisit
10 seconds after the the user has been on the page.
You can update the triggering time clock as you see fit based on the following encoding.
Examples:
- 10 seconds is encoded
10e3
- 120 seconds is encoded
120e3
Find out more about time encoding here.
Updated 3 months ago