Sha256: 9308fabb576e4221d8ceeb10a3210b07755cfe7534ce07a589c8cba9d9203e13
Contents?: true
Size: 799 Bytes
Versions: 10
Compression:
Stored size: 799 Bytes
Contents
(function() { "use strict"; GOVUK.analyticsPlugins = GOVUK.analyticsPlugins || {}; GOVUK.analyticsPlugins.mailtoLinkTracker = function () { var mailtoLinkSelector = 'a[href^="mailto:"]'; $('body').on('click', mailtoLinkSelector, trackClickEvent); function trackClickEvent(evt) { var $link = getLinkFromEvent(evt), options = {transport: 'beacon'}, href = $link.attr('href'), linkText = $.trim($link.text()); if (linkText) { options.label = linkText; } GOVUK.analytics.trackEvent('Mailto Link Clicked', href, options); } function getLinkFromEvent(evt) { var $target = $(evt.target); if (!$target.is('a')) { $target = $target.parents('a'); } return $target; } } }());
Version data entries
10 entries across 10 versions & 1 rubygems