@remindgmbh/typescript-google-analytics

0.2.0 • Public • Published

REMIND - TypeScript Utility Library

travis-img codecov-img github-issues-img contrib-welcome-img license-img

Minimal implementation of Google Analytics.

import { Analytics } from '@remindgmbh/typescript-google-analytics'

/** Create a new analytics instance with your tracker id */
const analytics: Analytics = new Analytics('UA-123456789-1')

/** Load and create analytics. This also checks for optout. */
analytics.loadScript()
analytics.create()

/** You can now use analytics to send a pageview */
window.ga('send', 'pageview')

/** Enable tracking of link clicks */
analytcs.assignClickEventHandler()

Todos

  • Add configuration options

Readme

Keywords

none

Package Sidebar

Install

npm i @remindgmbh/typescript-google-analytics

Weekly Downloads

2

Version

0.2.0

License

BSD-3-Clause

Unpacked Size

21 kB

Total Files

12

Last publish

Collaborators

  • remindtech