簡體   English   中英

Google Analytics(分析)表單跟蹤事件不起作用

[英]Google Analytics Form Tracking Events not working

我們正在嘗試在Google Analytics(分析)中跟蹤一種表格。 提交表單后,我們將執行以下代碼:

<script language=\"javascript\">_gaq.push(['_trackEvent', 'ProductForm', 'submit', window.location.href])</script>

這是我們在網站上全局使用的常規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-12345678-1', 'auto');
ga('send', 'pageview');
</script>

但是,表單事件未在Analytics(分析)中跟蹤。 您知道我們使用的特定跟蹤方法有什么問題嗎?還是只需要升級Analytics(分析)版本?

謝謝!

_gaq.push已過時,您將需要更新。

嘗試該代碼:

ga('send', 'event', {'page': window.location.href,'title': 'ProductForm'});

您可以在這里看到更多示例

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM