Created
June 7, 2012 16:27
-
-
Save gmurphey/2889880 to your computer and use it in GitHub Desktop.
Outbound link tracking with GA and jQuery
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
(function ($) { | |
$(function () { | |
$('a[href^="https?:"]:not(a[href^="https?://' + document.location.hostname + '"])').click(function () { | |
try { _gat._getTrackerByName()._trackEvent('Outbound Links', $(this).attr('href')); } catch (e) {} | |
}); | |
}); | |
}) (jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment