Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto events ignore specific links #699

Open
simpleanalyticsbot opened this issue Jul 9, 2023 · 0 comments
Open

Auto events ignore specific links #699

simpleanalyticsbot opened this issue Jul 9, 2023 · 0 comments
Labels
customer request Tasks created by customers via our website

Comments

@simpleanalyticsbot
Copy link
Collaborator

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 simpleanalyticsbot added the customer request Tasks created by customers via our website label Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer request Tasks created by customers via our website
Projects
None yet
Development

No branches or pull requests

1 participant