smartanalytics/README.md

65 lines
2.9 KiB
Markdown
Raw Permalink Normal View History

2017-02-24 02:00:15 +00:00
# smartanalytics
2018-10-28 22:32:12 +00:00
2017-02-24 02:00:15 +00:00
Google Analytics everywhere
## Availabililty
2018-10-28 22:32:12 +00:00
2017-02-24 02:00:15 +00:00
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartanalytics)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartanalytics)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartanalytics)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartanalytics/)
## Status for master
2018-10-28 22:32:12 +00:00
2017-02-24 02:00:15 +00:00
[![build status](https://GitLab.com/pushrocks/smartanalytics/badges/master/build.svg)](https://GitLab.com/pushrocks/smartanalytics/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartanalytics/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartanalytics/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartanalytics.svg)](https://www.npmjs.com/package/smartanalytics)
[![Dependency Status](https://david-dm.org/pushrocks/smartanalytics.svg)](https://david-dm.org/pushrocks/smartanalytics)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartanalytics/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartanalytics/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartanalytics/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartanalytics)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
## Usage
2018-10-28 22:32:12 +00:00
2017-02-24 02:00:15 +00:00
Use TypeScript for best in class instellisense.
2017-02-24 23:36:12 +00:00
### Why does this package exist?
2018-10-28 22:32:12 +00:00
2017-09-03 18:09:03 +00:00
Tracking users in webapps is common, often to gain insight in who is using what and where to spend dev resources for best efficiency.
2017-02-24 23:36:12 +00:00
2017-02-25 00:32:49 +00:00
Doing the same stuff in apps can be a bit of a hassle.
Unnecessary dependencies used by many existing analytics tools make the whole app slow
just to gain a little usage info.
2017-09-03 18:09:03 +00:00
**Say hello to smartanalytics. :)**
It features a very slim dependency tree using the native node request module to send posts to a tracking API of your choice.
2017-02-24 23:36:12 +00:00
### How do I use this package?
```javascript
2018-10-28 22:32:12 +00:00
import { Analytics } from 'smartanalytics';
2017-09-03 18:09:03 +00:00
let myAnalytics = new plugins.smartanalytics.Analytics({
apiEndPoint: 'https://somepubapi.endpoint.com',
projectId: 'gitzone',
appName: 'npmts'
2018-10-28 22:32:12 +00:00
});
2017-09-03 18:09:03 +00:00
2018-10-28 22:32:12 +00:00
myAnalytics
.recordEvent('someEvent', {
2017-09-03 18:09:03 +00:00
myKey1: 'myValue1',
myKey2: 'myValue2',
myDataKey3: 3
})
2018-10-28 22:32:12 +00:00
.catch(err => {
console.log(err);
});
2017-02-24 23:36:12 +00:00
```
2017-02-24 02:00:15 +00:00
For further information read the linked docs at the top of this README.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)