meh*_*kar 11 google-analytics ember.js
我想在这里获得一个明确的答案,以便以后参考我们有一个稳定的Ember RC.顶部2的组合搜索结果的emberjs google analytics显示,这是做轨道路线的变化的好办法:
App.ApplicationController = Ember.Controller.extend
routeChanged: ( ->
return unless window._gaq
Em.run.next ->
page = if window.location.hash.length > 0 then window.location.hash.substring(1) else window.location.pathname
_gaq.push(['_trackPage', page])
).observes('currentPath')
Run Code Online (Sandbox Code Playgroud)
但后来我也看到了对单页面Web应用程序使用事件跟踪的结果.
我还没有测试上面的代码,将更改传播到GA仪表板需要几个小时. 更新:这不会显示在我的Google Analytics信息中心的"内容"类别下.在"页面"或"事件"下都没有.
如果有人有建议,或者有什么东西我在某个地方遗失,请告诉我.我也可以根据这里的答案公关网站指南.
| 归档时间: |
|
| 查看次数: |
2468 次 |
| 最近记录: |