尤川豪   ·  4年前
445 貼文  ·  275 留言

自動強化版的 Google Analytics 套件 GA 官方開發的

這個好像是自動強化版的套件

GA 官方開發的

會自動追滿多事件 還有 ajax call 的瀏覽量 我到今天才知道 囧

https://github.com/googleanalytics/autotrack

  分享   共 1,246 次點閱
按了喜歡:
共有 1 則留言
尤川豪   ·  4年前
445 貼文  ·  275 留言

SPA pageview 寫法

ga('set', 'page', location.pathname);
ga('send', 'pageview');

While technically the send command for pageview hits accepts an optional page field as the third parameter, passing the page field that way is not recommended when tracking single page applications. This is because fields passed via the send command are not set on the tracker—they apply to the current hit only. Not updating the tracker will cause problems if your application sends any non-pageview hits (e.g. events or social interactions), as those hits will be associated with whatever page value the tracker had when it was created.

https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications

 
按了喜歡:
您的留言
尤川豪
445 貼文  ·  275 留言

Devs.tw 是讓工程師寫筆記、網誌的平台。隨手紀錄、寫作,方便日後搜尋!

歡迎您一起加入寫作與分享的行列!

查看所有文章