mixpanel-js
mixpanel-js copied to clipboard
GET track_links canceled
The event for the links are firing off, but they are always canceled. I thought it might the browser trying to switch pages, so I increased the timeout to as far as 10 seconds, and it still cancels. What's the proper fix for this?
Here's my implementation:
function getLinkData(element) {
return { description: element.getAttribute('mixpanel-event-name') };
}
document.addEventListener('DOMContentLoaded', function() {
mixpanel.set_config({
track_links_timeout: 10000, // 10 seconds
})
mixpanel.track_links('.mixpanel-link', 'Clicked Free Trial Link', getLinkData);
}, false);