mixpanel-js icon indicating copy to clipboard operation
mixpanel-js copied to clipboard

GET track_links canceled

Open moneytree-doug opened this issue 7 years ago • 0 comments

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);

moneytree-doug avatar Nov 13 '17 05:11 moneytree-doug