labjs加载谷歌分析
有人使用 LABjs 来加载谷歌分析吗?
您将其包含在链中的什么位置?
我找到了这个脚本,但不确定是否要在之前或之后包含我的其他脚本
$LAB
.script("js/myscripts.js") //here?
.script(('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js')
.wait(function(){
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._trackPageview();
.script("js/myscripts.js") //or here?
});
另外,有没有人将 LABjs 与 getclicky 一起使用?您是否为 google-analytics 做了类似于上述负载链的操作?
Has anyone used LABjs for loading google analytics?
Where do you include it in the chain?
I found this script but wasn't sure whether to include my other scripts before or after
$LAB
.script("js/myscripts.js") //here?
.script(('https:'==document.location.protocol?'https://ssl':'http://www')+'.google-analytics.com/ga.js')
.wait(function(){
var pageTracker = _gat._getTracker("UA-XXXXX-X");
pageTracker._trackPageview();
.script("js/myscripts.js") //or here?
});
Also, has anyone used LABjs with getclicky? Did you do something similar to the above load chain for google-analytics?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
建议的选项是为谷歌分析创建另一个加载链。
在一条链中加载谷歌分析脚本,在另一条链中加载您的代码。
引用 Kyle 的如何使用 LabJs 加载 GA 的要点。
我没有使用过 getclicky 但我认为上面的答案也涵盖了这一点。
The suggested option is to make another loading chain for google analytics.
Load google analytics script in one chain and your code in the other.
Quote from a gist showing how to load GA with LabJs by Kyle.
I have not used getclicky but I would assume the above answer covers that as well.