An open API service indexing awesome lists of open source software.

https://github.com/pirxpilot/ga-event

Google Analytics component with event tracking
https://github.com/pirxpilot/ga-event

Last synced: about 1 month ago
JSON representation

Google Analytics component with event tracking

Awesome Lists containing this project

README

          

# ga

Google Analytics event tracking
Use instead of `ga` component to track pages *and* events

## Installation

TBD

## API

Activate Google Analytics on the page and track page

require('ga')("UA-XXXX-X");

Alternatively you can define GA property ID as a data attribute of document body

You can [track events][1] by declaring event properties in HTML


Click here

You only need to set `ga-category`. `ga-action` defaults to `click` and `ga-label`, `ga-value`, and
`ga-noninteractive` are all optional in Google Analytics.

`ga-event` registers DOM event handler that will generate `trackEvent` call whenever item is clicked.

Check [test/index.html] for example.

## License

MIT

[test/index.html]: https://github.com/pirxpilot/ga-event/blob/master/test/index.html
[1]: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide