0.2.0 • Published 3 years ago

@remindgmbh/typescript-google-analytics v0.2.0

Weekly downloads
1
License
BSD-3-Clause
Repository
github
Last release
3 years ago

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