Is it possible to track user exit time or if a user is about to leave a widget, in our case a PowerBI iframe widget? The widget gets populated on the page upon button/tab click, and there are multiple tabs on same page.
I am trying to capture user time spent on each widget, I already a code to track user click on the tab, but i need to find a way to track when user leaves the tab, so i can find the difference of both the timestamps.
//Recording Click Events
document.getElementById('headgsocial').addEventListener('click',function (e) {
newrelic.addPageAction('clickedGsocial');
})