有人可以看到此处的代码存在问题,无法跟踪此按钮吗? 修复了上一篇文章,但新代码仍然没有:
<form id="constant-contact-signup2" action="http://www.truckingoffice.com/trucking-software-blog" method="post">
<div class="kws_input_fields">
<div class='cc_email_address kws_input_container'>
<label for='cc_email_address' class=''> Sign up for our Trucking Office Newsletter <span class="req" title="The Sign up for our Trucking Office Newsletter field is required">*</span></label>
<input type='text' value='' size="30" placeholder='john.appleseed@apple.com' name='fields[email_address][value]' class='t required' id='cc_email_address' />
<input type="hidden" name="fields[email_address][label]" value=" Sign up for our Trucking Office Newsletter " />
<input type="hidden" name="fields[email_address][req]" value="1" /></div>
<input type="submit" style='position:absolute; width:0;height:0;visibility:hidden!important;' name='constant-contact-signup-submit' onclick=”_gaq.push(['_trackEvent', 'Button', 'Click']);” />
SafeSubscribe的隐私
整个星期都在做这个,但仍然没有。任何帮助都将非常感谢!
答案 0 :(得分:0)
_trackEvent
和_trackPageview
通过向Google服务器发出跟踪像素请求来工作 - 您可能会遇到由于请求呈现新页面而取消图像请求的计时问题。一个常见的解决方案是在跟踪调用后将表单提交延迟一小段。
使用jQuery,如:
jQuery(function($){
$('#constant-contact-signup2 input[type=submit]').click(function(e){
e.preventDefault();
_gaq.push(['_trackEvent', 'Button', 'Click']);
setTimeout(function(){$('#constant-contact-signup2').submit()}, 150);
});
})