Created
October 22, 2015 20:53
-
-
Save jstnkrr/06dcf523dc83d07f1070 to your computer and use it in GitHub Desktop.
Trigger GA Event for Telephone Links
This file contains hidden or 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
/** | |
* Bind GA event to tel: links | |
*/ | |
jQuery(document).ready(function($) { | |
$("a[href^='tel:']").on('click', function(e) { | |
ga('send', 'event', 'phone', 'call', document.title + ' called ' + decodeURIComponent(this.href), 25); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment