Created
January 23, 2021 20:16
-
-
Save vanaf1979/d93d04e4b58285365598139c6b55eb79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const emailLinks = document.querySelectorAll('a[href^="mailto:"]'); | |
emailLinks.forEach(function(emailLink){ | |
emailLink.addEventListener('click', () => { | |
gtag('event', 'link_click', { | |
event_category: 'Links', | |
event_action: 'Click', | |
event_label: 'Email link' | |
}); | |
}, { once: true }); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment