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