我的网站上有一个按钮,单击此按钮会显示一个电话号码.
HTML
<div class="call-wrapper-middle">
<button id="call-phone-middle"><i class="fa fa-phone"></i>Call us</button>
<div class="call-number-middle" style="display: block;"> <a href="tel:555" class="number">555</a></div>
</div>
Run Code Online (Sandbox Code Playgroud)
使用以下jQuery
(function($) {
$("button#call-phone-middle").click(function() {
$(this).hide();
$("div.call-number-middle").show();
});
})(jQuery);
Run Code Online (Sandbox Code Playgroud)
这非常有效.但我也希望跟踪按钮上的点击次数作为Google Analytics中的目标.
所以我添加href="/show/phonenumber-middle" onclick="javascript:pageTracker._trackPageview (‘Phonenumber Middle’);" target="blank"到按钮:
<div class="call-wrapper-middle">
<button href="/show/phonenumber-middle" onclick="javascript:pageTracker._trackPageview (‘Phonenumber Middle’);" target="blank" id="call-phone-middle"><i class="fa fa-phone"></i>Call us</button>
<div class="call-number-middle" style="display: block;"> <a href="tel:555" class="number">555</a></div>
</div>
Run Code Online (Sandbox Code Playgroud)
并使用以下设置在Google Analytics中添加了目标:
目标设定:Custom
目标类型:Destination
目的地; 等于:/show/phonenumber-middle
获取"此目标将根据您的数据获得0%的转化率",而在实时报告中则没有对话.
我的猜测是有问题,<button>但我不知道.
我好像有点脑子放屁了。我已经让 Google 正确计算了我的转换,但我得到了误报。
这是目前的目标正则表达式,效果很好。
^/click/[0-9]+\.html\?.*
Run Code Online (Sandbox Code Playgroud)
但我也希望 RegEx 不包含任何内容,&confirm=1我对如何在 RegEx 中做到这一点感到非常困惑,我认为我可能能够使用[^(?:&confirm=1)],但我认为这是无效的。
我已经尝试使用这个RegEx来在GA中设置一个目标2天,但我无法理解它...
URL格式如下:
/purchase.php?cDd=1&transaction_id=xxxxxxx&verify=xxxxxxxxxxxxxxxx=&method=creditcard&type=purchase
Run Code Online (Sandbox Code Playgroud)
transaction_id =填充了一个
verify=数字,由一串数字,两个大写字母和小写字母填充
基本上我只想匹配完成的URL &method=creditcard&type=purchase
我试图放,&method=creditcard&type=purchase但它确实检索其他URL.