@umbrellio/ga-tracker

0.3.1 • Public • Published

@umbrellio/ga-tracker

Coverage Status Build Status

Google Analytics tracker for web env (no window object required).

Install

$ yarn add @umbrellio/ga-tracker

Usage

import GATracker from "@umbrellio/ga-tracker"

const tracker = GATracker.create(trackingId)

tracker.pageview({ dp: "/contacts", dt: "Contacts" })

Where trackingId is your app tracking id (like UA-XXXXXXXXX-X).

Available methods:

  • set(key, value) – set any global var (like user params)

  • pageview({ dl, dh, dp, dt }) – track page viewing (Docs)

  • timing({ utc, utv, utt, utl }) – track custom timings (Docs)

Errors

NetworkError

import GATracker from "@umbrellio/ga-tracker"

GATracker.Errors.NetworkError

Throws when there was an error while sending a http request.

ConnectionError

import GATracker from "@umbrellio/ga-tracker"

GATracker.Errors.ConnectionError

Throws when unable to send a http request.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/umbrellio/ga-tracker.

License

Released under MIT License.

Authors

Created by Aleksei Bespalov,

Supported by Umbrellio

Readme

Keywords

none

Package Sidebar

Install

npm i @umbrellio/ga-tracker

Weekly Downloads

0

Version

0.3.1

License

MIT

Unpacked Size

43.7 kB

Total Files

20

Last publish

Collaborators

  • tysky
  • nulldef
  • akxcv