Tôi đang cố gắng thiết lập theo dõi sự kiện trên trang web của mình nhưng không thể làm cho nó hoạt động chính xác.Theo dõi sự kiện Google Analytics trên mã nhấp chuột
mã theo dõi của tôi:
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-420xxxxxxx', 'mywebsite.org');
ga('send', 'pageview');
</script>
mã theo dõi sự kiện của tôi:
<a href="#PurchasePanelLink" class="uk-button uk-button-primary" onClick="$('#PurchasePanel').show(); _gaq.push(['_trackEvent', 'Button', 'Click', 'Purchase Details',, false]);">Purchase Details</a>
Man I love overflow overflow. Mọi người đều rất hữu ích. Cảm ơn bạn! – Casey
OnClick có được hỗ trợ không? Không thể thấy bất kỳ đề cập nào về loại triển khai này trong hướng dẫn mới nhất của GA: https://developers.google.com/analytics/devguides/collection/analyticsjs/events#implementation – jnthnclrk
FYI, đây là tham chiếu cú pháp * * https://developers.google.com/analytics/devguides/collection/upgrade/reference/gajs-analyticsjs –