我想要跟踪有多少人注册了时事通讯。我可以在Google Analytics中使用事件跟踪功能。但是有一个问题。我在按钮上找到了下面的代码
<form name="ccoptin" action="http://visitor.r20.constantcontact.com/d.jsp" target="_blank" method="post" onsubmit="return SubscribeValidate()">然后,我必须在其中放置以下代码
onClick="_gaq.push(['_trackEvent', 'newsletter signup', 'email', 'Sidebar',, false]);"发布于 2012-10-24 20:09:36
onClick正在跟踪按钮。对于表单,将代码添加到成功的“验证”函数和/或“谢谢”页面。
var SubscribeValidate = function () {
// Make sure the form is filled out
if ($("#email").text() != "") {
return false;
}
// Track in Google Analytics
_gaq.push(['_trackEvent', 'newsletter signup', 'email', 'Sidebar', , false]);
window.location = "/thanks"; // or $("#modal").modal();
}https://stackoverflow.com/questions/13047975
复制相似问题