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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?