2017-02-03 141 views
0

我在使用Google Goals進行我的事件跟蹤時遇到問題。我甚至將Google代碼添加到我的網頁上。不過,我無法檢查Google Goals中的任何轉化,但事件結果可顯示在Google Analytic - > Behavior - > Events Overview中。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','https://www.google-analytics.com/analytics.js','ga'); 

    ga('create', 'UA-87810245-1', 'auto'); 
    ga('send', 'pageview'); 

</script> 
     <script> 

$('#contact-form').on('submit', function(event) { 
    // Prevent the browser's default form submission action. 
    event.preventDefault(); 

    ga('send', 'event', { 
    eventCategory: 'Contact', 
    eventAction: 'Information Request', 
    eventLabel: 'Contact Form', 
    hitCallback: function() { 
     $('contact-form').trigger('submit'); 
    } 
    }); 
}); 

     </script>` 

代碼爲我的提交按鈕:

<input type="submit" id="submit" value="Validate and Submit" onclick="ga('send', 'event', 'form', 'submit', 'order sent', 10);"/> 

我的谷歌目標:

enter image description hereenter image description here

谷歌Analytics(分析)事件概述: enter image description here

回答

1

所以你有兩個事件正在進行,一個用於點擊提交按鈕(也許跟蹤意圖),一個用於表單提交本身。您的目標被配置爲預期值爲Greater than 10,但您的表單提交事件未傳入值。您應該添加一個值(大於10),或者從目標配置中刪除該值。此外,您的屏幕截圖顯示的可能只是點擊事件(因爲有10個值與它關聯),但您可能對實際提交的內容更感興趣。

相關問題