0

任何人都可以看到这里用于跟踪此按钮的代码有问题吗?从上一篇文章中修复了它,但新代码仍然没有:

<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 的隐私

整个星期都在研究这个,但仍然一无所获。任何所有帮助将不胜感激!

4

1 回答 1

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);
  });
})
于 2013-04-02T14:25:57.743 回答