diff --git a/plugin.php b/plugin.php index 78b06df..96c8634 100644 --- a/plugin.php +++ b/plugin.php @@ -20,6 +20,17 @@ function render() _gaq.push(['_trackPageview']); _gaq.push(['_anonymizeIP', {$anonymize}]); + $(function() { + $.pjax && $(window).on('k-pjax-end', function() { + _gaq.push(['_trackPageview']); + }); + $('.social-links li,.kshare-items li').not(function() { + return $(this).find('a').hasClass('no-share'); + }).on('click', function() { + _gaq.push(['_trackSocial', $(this).find('a').text().toLowerCase()]); + }); + }); + (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';