How to track mailto links on a website (not in email)? | Community
Skip to main content
New Participant
July 29, 2021
Solved

How to track mailto links on a website (not in email)?

  • July 29, 2021
  • 1 reply
  • 1733 views

Hello community!

 

How to track mailto links on a website (not in email)?

 

All I found here on Marketing Nation is this post from 2019 by @sanfordwhiteman where he provides the following piece of code:

 

 

(function() { var arrayify = getSelection.call.bind([].slice); arrayify(document.links).filter(function(link) { return link.protocol == "mailto:"; }).map(function(mailToLink) { mailToLink.addEventListener("click", function(e) { Munchkin.munchkinFunction("clickLink", { href: this.href }); }); }); })();

 

 

Questions:

 

- Is this the recommended best way to add support for tracking mailto links on a website?

 

Note

- Munchkin does NOT track mailto links out-of-the-box (there are more links that munchkin does not track as default, more info here: https://blog.teknkl.com/more-munchkin-untracked-links-part-1/).

 

Thanks for the help in advance!

 

Best,

ernie

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

There’s no better way than my code above.

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
July 29, 2021

There’s no better way than my code above.