roadmap icon indicating copy to clipboard operation
roadmap copied to clipboard

Auto events ignore specific links

Open simpleanalyticsbot opened this issue 1 year ago • 0 comments

I like the auto events script, however it would be nice to be able to exclude specific outbound links.

A solution could be adding a data- atrribute, for example data-sa-nocapture. In the loop you could check for that.

<a href="https://example.com" data-sa-event-ignore>bla</a>
// Loop over all links on the page
      for (var i = 0; i < a.length; i++) {
        var link = a[i];
        var href = link.getAttribute("href");

        // Skips links with data-sa-event-ignore data attribute
        if(link.dataset.saEventIgnore != null) continue;

simpleanalyticsbot avatar Jul 09 '23 10:07 simpleanalyticsbot