Skip to content

Instantly share code, notes, and snippets.

@BramEsposito
Last active November 29, 2017 14:20
Show Gist options
  • Save BramEsposito/379c7bc83ba333326079887b93b98965 to your computer and use it in GitHub Desktop.
Save BramEsposito/379c7bc83ba333326079887b93b98965 to your computer and use it in GitHub Desktop.
Google Tag Manager: Custom event tracking
<script>
(function() {
$(".fully-clickable").on("click", function(event) {
dataLayer.push({
"event":"fullyclickable event",
"fully-clickable url": new URL($(event.target).find('a:last').attr('href'), window.location.href).href
});
});
})();
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment