@whitewizard/analytics

2.10.4 • Public • Published

Analytics

dist/analytics.js is built by Webpack from src/analytics.js

Usage

  • import Analytics from '@whitewizard/analytics'

  • let analytics = new Analytics()

  • Set data for pageview:

    • analytics.setData({user, rootSection, article, section}), parameters:
      • user: 'secure.pmo.ee/api/me/' response object
      • rootSection: needed in all views
      • article: needed only in article view. Not all parameters are required. Will console.error when required params are missing
      • section: needed only in section view
  • Trigger pageview:

    • analytics.triggerPageView()
  • In case of single page applications, run the constructor once and only change the data afterwards. Trigger a new pageview after every navigation

Development

  • npm install
  • webpack

Prod build

  • npm run build

Readme

Keywords

none

Package Sidebar

Install

npm i @whitewizard/analytics

Weekly Downloads

29

Version

2.10.4

License

ISC

Unpacked Size

76.3 kB

Total Files

8

Last publish

Collaborators

  • whitewizard