gpt4 book ai didi

javascript - 查看异步 JavaScript 调用

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:07:03 27 4
gpt4 key购买 nike

我已将 Google Analytics 的跟踪脚本升级到异步版本。我遇到的唯一问题是能够调试调用。我能够使用 this site 中概述的方法在 Firebug 中跟踪旧版本,但现在无法查看 gaq.push 调用。有没有办法在 Firebug 或其他工具中查看它?

这是我要跟踪的示例测试页:

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Google Analytics Event Tracking</title>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-13250000-1']);
_gaq.push(['_trackPageview']);

(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
Lorem ipsum dolor sit amet....<br />
<script type="text/javascript">
_gaq.push(['_trackEvent', 'Videos', 'Play', 'Gone With the Wind']);
</script>
</body>
</html>

我正在尝试确认“_gaq.push”确实有效。

最佳答案

我刚刚遇到了同样的问题,所以我进行了谷歌搜索并最终解决了这个堆栈溢出问题。我也认为这只会在 firebug 中显示为 xhr 请求,因为这是简单的方法跟踪事件。原来他们使用 1x1 像素的 gif 进行跟踪!如果您查看 Firebug 中的 Net > All 选项卡,您将看到一个看起来类似于此的 GET 请求:

https://ssl.google-analytics.com/__utm.gif?utmwv=5.2.4&utms=28&utmn=1818843630&utmhn=dev-marketplace.asos.com&utmt=event&utme=5(my-home*sub-nav-click*blog-posts)&utmcs=UTF-8&utmsr=1920x1080&utmvp=1920x618&utmsc=24-bit&utmul=en-gb&utmje=0&utmfl=11.1%20r102&utmdt=Build%20%23%20Developer%20Live%20Feed%20ASOS%20Marketplace&utmhid=1950484512&utmr=-&utmp=%2Flivefeed%2Fblogposts&utmac=UA-23521416-1&utmcc=__utma%3D159014575.706813547.1328542287.1328542287.1328604985.2%3B%2B__utmz%3D159014575.1328542287.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=6AAAAAAAAAAAAAAAQ~

这些是请求中发送的参数

utmac   UA-23521416-1
utmcc __utma=159014575.706813547.1328542287.1328542287.1328604985.2;+__utmz=159014575.1328542287.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none);
utmcs UTF-8
utmdt Build # Developer Live Feed ASOS Marketplace
utme 5(my-home*sub-nav-click*blog-posts)
utmfl 11.1 r102
utmhid 1950484512
utmhn dev-marketplace.asos.com
utmje 0
utmn 1818843630
utmp /livefeed/blogposts
utmr -
utms 28
utmsc 24-bit
utmsr 1920x1080
utmt event
utmu 6AAAAAAAAAAAAAAAQ~
utmul en-gb
utmvp 1920x618
utmwv 5.2.4

关于javascript - 查看异步 JavaScript 调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4737748/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com