@remindgmbh/typescript-google-analytics
v0.2.0
Published
Minimal Google Analytics for TypeScript.
Downloads
5
Readme
REMIND - TypeScript Utility Library
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