2
這是到目前爲止我的分析代碼:如何在谷歌分析中記錄trackevent?
(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', 'XXXX', {cookieDomain: 'none', legacyCookieDomain: 'none'});ga('send', 'pageview');
我想記錄一個事件是這樣的:
<a style="
color: #00b258; font-size: 15px;" onclick="ga('_trackEvent', 'Submit an inquiry', 'Click Submit Inquiry', 'Opened Inquiry form on ' + document.url);return true;" href="http://test.com">Submit An Inquiry</a>
但是,當我在Firebug淨面板去沒有請求被髮送。我錯過了什麼?我的語法錯了嗎?