analyticsjs-boilerplate

Examples and best practices for using analytics.js

  • 所有者: philipwalton/analyticsjs-boilerplate
  • 平台:
  • 許可證: ISC License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

analytics.js boilerplate

Best practices for implementing analytics.js on modern websites.

For an in-depth explanation of all the features used in this boilerplate (as well as how to report on them), see my article:

The Google Analytics Setup I Use on Every Site I Build

Boilerplate versions

analytics/base.js

The base boilerplate extends the default tracking snippet and includes the following features:

  • Tracks uncaught errors.
  • Tracks custom user, session, and hit-level dimensions.
  • Sends an initial pageview.
  • Sends a pageload performance event.

analytics/autotrack.js

The autotrack boilerplate builds on top the base boilerplate and includes select autotrack plugins

analytics/multiple-trackers.js

The multiple-trackers boilerplate builds on the autotrack boilerplate and includes support for using multiple trackers.

Running the boilerplate locally

analytics.js boilerplate uses webpack to compile the source and webpack-dev-server to run it locally.

To install the dependencies and load the boilerplate in a browser, run the following commands:

npm install
npm start

Then visit localhost:8080 in your browser and open the developer console to see the analytics.js debug output.

Running different boilerplate versions

The boilerplate index.js JavaScript file imports the base boilerplate by default. To run a different version, replace the URL imported via import('./analytics/base.js') with the version you want to load.

主要指標

概覽
名稱與所有者philipwalton/analyticsjs-boilerplate
主編程語言JavaScript
編程語言HTML (語言數: 2)
平台
許可證ISC License
所有者活动
創建於2017-02-01 17:41:52
推送於2017-09-09 18:10:53
最后一次提交2017-09-09 11:10:20
發布數3
最新版本名稱0.2.1 (發布於 )
第一版名稱0.1.0 (發布於 )
用户参与
星數1.1k
關注者數52
派生數58
提交數46
已啟用問題?
問題數17
打開的問題數5
拉請求數4
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?