https://github.com/spoqa/gaw
simple google analytics wrapper
https://github.com/spoqa/gaw
Last synced: 7 days ago
JSON representation
simple google analytics wrapper
- Host: GitHub
- URL: https://github.com/spoqa/gaw
- Owner: spoqa
- License: mit
- Created: 2017-07-23T17:24:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-25T05:17:31.000Z (almost 9 years ago)
- Last Synced: 2025-10-22T12:45:54.889Z (9 months ago)
- Language: TypeScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 11
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gaw
simple [google analytics](https://developers.google.com/analytics/) wrapper
# Usage
```sh
npm install gaw
```
```js
import { Tracker } from 'gaw';
const tracker = Tracker.init({ trackingId: 'UA-XXXX-Y' });
if (traditional_web_page) {
tracker.trackCurrentPage();
}
if (single_page_application) {
tracker.startSession('pageview');
tracker.trackPage('/blabla');
// tracker.endSession('pageview');
}
tracker.trackEvent('Carousel', 'slide to left');
```