Last active
August 29, 2015 14:19
-
-
Save theisof/2ed7f02766559a61b472 to your computer and use it in GitHub Desktop.
Turbolinks GTM click rule
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
$(document).on('click', 'a', function(event){ | |
event.preventDefault(); | |
var path = $(this).attr('href'); | |
dataLayer.push({'event':'pageview', 'turbolinksClick': true}); | |
Turbolinks.visit(path); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment