我有一个和DoubleClick的网站。在Sentry (错误跟踪)中,pubads_impl_xxx.js中有一些错误,但仅在Mobile Safari中。为什么会这样呢?我应该忽略它们,或者有什么方法可以修复它们吗?
谢谢
TypeError: Illegal invocation
at HTMLDocument.document.createEvent(:1:40918)
at Wc.l(/gpt/pubads_impl_2020101501.js:6:89381)
at $c(/gpt/pubads_impl_2020101501.js:6:15725)
at bd.next(/gpt/pubads_impl_2020101501.js:6:16017)
at ? (/gpt/pubads_impl_2020101501.js:6:29861)
at new Promise(<anonymous>)
at Xa(/gpt/pubads_impl_2020101501.js:6:29629)
at Po.jn.dispatchEvent(/gpt/pubads_impl_2020101501.js:6:89295)
at cz._.q.Yb(/gpt/pubads_impl_2020101501.js:6:262763)
at Object.<anonymous>(/gpt/pubads_impl_2020101501.js:6:120833)
发布于 2020-10-30 12:23:51
这似乎是一个已知的ISSUE 1811前哨javascript,与blacklistUrls
不能在iOS9 Mobile Safari上工作有关。
建议的解决方案是更新blacklistUrls
以使用正则表达式或在beforeSend
回调中处理检查。
在问题所附的代码中,错误是由于facebook爬虫而发生的,你可以做类似的检查,找出谷歌爬虫使用的url。
Sentry.init({
beforeSend: function (event) {
// Drop all events if query string includes `fbclid` string
if (location.search.indexOf('fbclid') !== -1) return null;
// Otherwise just let it though
return event;
}
});
https://stackoverflow.com/questions/64497012
复制相似问题