From 457ac52a148552e0f455f1ac0a03c6fbacca812d Mon Sep 17 00:00:00 2001 From: Phil Kunz Date: Sun, 3 Sep 2017 20:09:03 +0200 Subject: [PATCH] update docs --- README.md | 27 ++++++++++++++++++++------- docs/index.md | 27 ++++++++++++++++++++------- 2 files changed, 40 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index c323dd7..935f0fd 100644 --- a/README.md +++ b/README.md @@ -22,23 +22,36 @@ Google Analytics everywhere Use TypeScript for best in class instellisense. ### Why does this package exist? -Tracking users in webapps is common. We use Google Analytics to gain insight in who is using what -and where to spend resources for best efficiency. +Tracking users in webapps is common, often to gain insight in who is using what and where to spend dev resources for best efficiency. 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. -Say hello to smartanalytics. -It features a very slim dependency tree using the native node request module to send posts to Google Analytics. + +**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. ### How do I use this package? ```javascript -import {AnalyticsAccount} from 'smartanalytics' -let myAnalyticsAccount = new AnalyticsAccount('My App Name', 'UA-XXXXXX-Y') -myAnalyticsAccount.sendEvent('npmtool', 'install', 'somelabel') +import { Analytics } from 'smartanalytics' +let myAnalytics = new plugins.smartanalytics.Analytics({ + apiEndPoint: 'https://somepubapi.endpoint.com', + projectId: 'gitzone', + appName: 'npmts' +}) + +myAnalytics.recordEvent('someEvent', { + myKey1: 'myValue1', + myKey2: 'myValue2', + myDataKey3: 3 + }).catch(err => { + console.log(err) + }) ``` + + For further information read the linked docs at the top of this README. > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh) diff --git a/docs/index.md b/docs/index.md index c323dd7..935f0fd 100644 --- a/docs/index.md +++ b/docs/index.md @@ -22,23 +22,36 @@ Google Analytics everywhere Use TypeScript for best in class instellisense. ### Why does this package exist? -Tracking users in webapps is common. We use Google Analytics to gain insight in who is using what -and where to spend resources for best efficiency. +Tracking users in webapps is common, often to gain insight in who is using what and where to spend dev resources for best efficiency. 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. -Say hello to smartanalytics. -It features a very slim dependency tree using the native node request module to send posts to Google Analytics. + +**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. ### How do I use this package? ```javascript -import {AnalyticsAccount} from 'smartanalytics' -let myAnalyticsAccount = new AnalyticsAccount('My App Name', 'UA-XXXXXX-Y') -myAnalyticsAccount.sendEvent('npmtool', 'install', 'somelabel') +import { Analytics } from 'smartanalytics' +let myAnalytics = new plugins.smartanalytics.Analytics({ + apiEndPoint: 'https://somepubapi.endpoint.com', + projectId: 'gitzone', + appName: 'npmts' +}) + +myAnalytics.recordEvent('someEvent', { + myKey1: 'myValue1', + myKey2: 'myValue2', + myDataKey3: 3 + }).catch(err => { + console.log(err) + }) ``` + + For further information read the linked docs at the top of this README. > MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)