Guest User

Untitled

a guest
Oct 15th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. /**
  2. * Registers a click handler for all mailto links on the page and fires
  3. * an Infinity Tracking custom trigger when clicked
  4. * We use 'live' for mailto links loaded after the DOM is ready
  5. * @author Chris Sedlmayr <chris.sedlmayr@infinity-tracking.com>
  6. */
  7. // copy of initialise the infinity var
  8. var _ictt = _ictt || [];
  9. $(document).ready(function() {
  10. // find 'a' elements that have an href starting with mailto:
  11. $('a[href^="mailto:"]').live('click', function() {
  12. // ensure the infinity variable is available
  13. if (typeof _ictt != 'undefined') {
  14. // track this, using the mailto location as the title
  15. _ictt.push([
  16. '_customTrigger',
  17. 'MAILTOCLICK',
  18. {
  19. 't':this.href.replace(/^mailto\:/i, '')
  20. }
  21. ]);
  22. };
  23. });
  24. });
Add Comment
Please, Sign In to add comment