简体   繁体   English

谷歌分析中的 iOS 电话超链接 javascript 跟踪

[英]iOS tel hyperlink javascript tracking in Google Analytics

I have some js code to record outbound link click events in Google Analytics, which effectively adds a delay to the click event before allowing the normal click behaviour to go through.我有一些 js 代码来记录 Google Analytics 中的出站链接点击事件,这在允许正常点击行为通过之前有效地增加了点击事件的延迟。

This applies to both http as well as tel: links.这适用于httptel:链接。 I trigger a specific "phone number has been clicked" event in GA so we know the user intended to make a call (whether or not they go through with it is a different issue entirely).我在 GA 中触发了一个特定的“电话号码已被点击”事件,因此我们知道用户打算拨打电话(他们是否接听电话完全是另一个问题)。

The number of events being tracked into GA seems strangely low and with anecdotal testing, many deliberately triggered events don't seem to show up in GA (Ie I sit on my phone and press the link a few times).被跟踪到 GA 中的事件数量似乎少得惊人,而且通过轶事测试,许多故意触发的事件似乎没有出现在 GA 中(即我坐在手机上按几次链接)。

I wonder why this could be.我想知道为什么会这样。

Does iOS do something weird to immediately halt or bypass my javascript when a tel: link is clicked?当一个tel:链接被点击时,iOS 是否做了一些奇怪的事情来立即停止或绕过我的 javascript? If not, what could explain the lack of event tracking going on here?如果不是,什么可以解释这里缺少事件跟踪?

For context, I'm talking about tracking the click event before the call prompt comes up:对于上下文,我指的是在呼叫提示出现之前跟踪点击事件:

iOS 通话提示

i had the same issue (working with jquery) and found out that it occurs when i tried to recognize the tap with jquery click handler.我遇到了同样的问题(使用 jquery)并发现它发生在我尝试使用 jquery 单击处理程序识别水龙头时。 i found a solution with adding我找到了添加的解决方案

jquery.on("click touchstart", function(e){...});

now it works fine again on desktop and mobile/touch browsers (tested on newer ios and android devices) and the call-prompt is displayed immediately.现在它在桌面和移动/触摸浏览器上再次正常工作(在较新的 ios 和 android 设备上测试)并且立即显示呼叫提示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM