Skip to content

Instantly share code, notes, and snippets.

@theaccordance
Created May 6, 2013 02:28
Show Gist options
  • Select an option

  • Save theaccordance/5523061 to your computer and use it in GitHub Desktop.

Select an option

Save theaccordance/5523061 to your computer and use it in GitHub Desktop.
jQuery method which runs the Google Analytics Function recordOutboundLinks for links that open a new window.
$(window).load(function () {
$('a[target=_blank]').each(function(){
$(this).attr('onClick', "recordOutboundLink(this, 'Outbound Links', '"+$(this).attr('data-name')+"');return true;");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment