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
- Host: GitHub
- URL: https://github.com/pirxpilot/ga-event
- Owner: pirxpilot
- License: mit
- Created: 2013-12-09T21:07:34.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2017-02-23T09:09:45.000Z (over 9 years ago)
- Last Synced: 2025-03-23T23:45:46.495Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- Changelog: History.md
- License: License.txt
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
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