Skip to content

Instantly share code, notes, and snippets.

@sperand-io
Created January 26, 2016 18:51
Show Gist options
  • Save sperand-io/79cb9ffcde6b58ead596 to your computer and use it in GitHub Desktop.
Save sperand-io/79cb9ffcde6b58ead596 to your computer and use it in GitHub Desktop.
Track Link Dynamic Properties Example
// links are DOM element(s) (multiple or singular)
//
// var links = document.querySelectorAll('a');
// var links = document.getElementByTagName('#specificLink')
analytics.trackLink(links, 'Clicked Link', function(link) {
return {
url: link.href,
copy: link.innerText
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment