1
我的谷歌分析事件最近因未知原因停止工作。我沒有對我的代碼做任何修改,我很確定沒有其他人也這麼做。我通過它檢查,它看起來應該工作。任何人都可以發現這個問題嗎?Onclick事件無法在Google Analytics中記錄
首先我的頭腳本:
<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-?????????-1', 'auto');
ga('send', 'pageview');
</script>
下觸發該事件的按鈕:
<input name="button" type="button" class="button" onClick="return checkValues(true); ga('send', 'event', { eventCategory: 'lead', eventAction: 'click', eventLabel: 'clickonform'}); " value="Submit" width="20px" />
,當然還有我的Analytics設置自己。
(3)目標詳細信息
類別 - 等於 - 引領
行動 - 等於 - 點擊
標籤 - 等於 - clickonform
值 - 大於 - 0
使用事件值作爲轉換的目標值
也許這是星期五的事情,我忽略了一些明顯的東西,但我的大腦不能環繞這個,任何幫助將不勝感激!
感謝您的反饋。如果我理解正確,那麼您提出以下建議:onClick =「ga('send','event',{eventCategory:'lead',eventAction:'click',eventLabel:'clickonform'}); return checkValues(true); 「問題是這不起作用。 – Patrick
「checkValues」函數返回什麼?嘗試通過確定它是onclick代碼的順序問題還是僅僅checkValues(true)或其他問題來縮小問題的範圍。 – nyuen