# analytica

> A library to integrate analytics to nodejs applications

Latest version **1.1.3** (published 2018-06-28) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install analytica
pnpm add analytica
yarn add analytica
bun add analytica
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.3 |
| Published | 2018-06-28 |
| First published | 2018-03-26 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 25 |
| Unpacked size | 70.7 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | izavits |
| Maintainers | izavits |
| Keywords | analytics, node, nodejs |

## Links

- npm: https://www.npmjs.com/package/analytica
- Repository: https://github.com/izavits/node.analytics
- Homepage: https://github.com/izavits/node.analytics#readme
- Issues: https://github.com/izavits/node.analytics/issues
- npm.io page: https://npm.io/package/analytica

## Dependencies (25)

- [is](https://npm.io/package/is.md) ^3.1.0
- [arch](https://npm.io/package/arch.md) ^2.1.0
- [uuid](https://npm.io/package/uuid.md) ^2.0.2
- [debug](https://npm.io/package/debug.md) ^3.1.0
- [raven](https://npm.io/package/raven.md) ^2.3.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.4
- [bind-all](https://npm.io/package/bind-all.md) ^1.0.0
- [mixpanel](https://npm.io/package/mixpanel.md) ^0.9.1
- [gosquared](https://npm.io/package/gosquared.md) 3.1.0
- [next-tick](https://npm.io/package/next-tick.md) ^0.2.2
- [os-locale](https://npm.io/package/os-locale.md) ^2.1.0
- [to-no-case](https://npm.io/package/to-no-case.md) ^0.1.3
- [lodash-deep](https://npm.io/package/lodash-deep.md) ^2.0.0
- [@segment/spy](https://npm.io/package/@segment/spy.md) ^1.0.0
- [@segment/stub](https://npm.io/package/@segment/stub.md) ^1.0.0
- [@segment/store](https://npm.io/package/@segment/store.md) ^1.3.20
- [component-bind](https://npm.io/package/component-bind.md) ^1.0.0
- [component-type](https://npm.io/package/component-type.md) ^1.2.1
- [analytics-events](https://npm.io/package/analytics-events.md) ^2.0.2
- [segmentio-facade](https://npm.io/package/segmentio-facade.md) ^3.0.2
- [component-emitter](https://npm.io/package/component-emitter.md) ^1.2.1
- [universal-analytics](https://npm.io/package/universal-analytics.md) ^0.4.16
- [@segment/convert-dates](https://npm.io/package/@segment/convert-dates.md) ^1.0.0
- [@segment/to-iso-string](https://npm.io/package/@segment/to-iso-string.md) ^1.0.1
- [@segment/isodate-traverse](https://npm.io/package/@segment/isodate-traverse.md) ^1.0.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.3 (latest) — 2018-06-28
- 1.1.2 — 2018-05-11
- 1.1.1 — 2018-04-24
- 1.1.0 — 2018-03-28
- 1.0.4 — 2018-03-26
- 1.0.3 — 2018-03-26
- 1.0.2 — 2018-03-26
- 1.0.1 — 2018-03-26

## README

# node.analytics

> A library to integrate analytics to nodejs applications

[![Build Status](https://travis-ci.org/izavits/node.analytics.svg?branch=master)](https://travis-ci.org/izavits/node.analytics)
[![npm](https://badge.fury.io/js/analytica.svg)](https://www.npmjs.com/package/analytica)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
[![Semver](https://img.shields.io/:semver-2.0.0-brightgreen.svg?style=flat-square)](http://semver.org)

## Install
Via npm:

```
npm install --save analytica
```

## API
The module exports methods to:
- require the core analytics lib
- require the provided integrations
- add the desired integration
- initialize the library
- track event

Example usage:

Require the core analytics library and the mixpanel integration:

```
var analytics = require('analytica').core;
var mp = require('analytica').mixpanelIntegration;
analytics.addIntegration(mp);
var options = {token: "<YOUR_TOKEN>"};
analytics.initialize({'Mixpanel': options});
```

Identify user and track event:

```
analytics.identify(123, { name: 'testuser', email: 'testemail@test.com', '$distinct_id': 123 },
  function () {
    console.log('done identifying user');
  });

analytics.track('my event', { distinct_id: 123, descr: 'test event' },
  function () {
    console.log('done tracking event');
  });
```

## Support
If you're having any problem, please raise an issue on GitHub

## Tests
Run the test suite by doing:

```
npm test
```

## License
The project is licensed under the Apache 2.0 license.

---
_Source: https://npm.io/package/analytica · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
