簡體   English   中英

我一直在嘗試使用 JavaScript 跟蹤我網站上發生的事件。但是該代碼不起作用

[英]I have been trying to track Events occurring in my website using JavaScript. But that code is not working

 jQuery(document).ready(function() { console.log("function reached"); jQuery("form").submit(function() { analytics.track("Apply Now", { firstName: document.getElementById("header_form_first_name").value, `Help to track firstname by using ID` }); }); });

上面的代碼是我在 WordPress 中的代碼,但它返回 null 值,我不知道為什么它返回 null 值

$(function(){
  // Use FORM ID to identify the form and invoke the submit
  $('#myForm').submit(function()
  {
   analytics.track("Apply Now", {
   firstName: 
   document.getElementById("header_form_first_name").value,
  `Help to track firstname by using ID`
  });
 }

暫無
暫無

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

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