# vue-keen-tracking

> Vue plugin for Keen.io tracking

Latest version **1.0.5** (published 2019-03-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install vue-keen-tracking
pnpm add vue-keen-tracking
yarn add vue-keen-tracking
bun add vue-keen-tracking
```

## 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.0.5 |
| Published | 2019-03-06 |
| First published | 2019-02-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 80.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | maxpaj |
| Maintainers | maxpaj |
| Keywords | vue, keen, keenio, keen.io, tracking, analytics, vuejs |

## Links

- npm: https://www.npmjs.com/package/vue-keen-tracking
- npm.io page: https://npm.io/package/vue-keen-tracking

## Dependencies (1)

- [keen-tracking](https://npm.io/package/keen-tracking.md) ^4.1.0

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2019-03-06
- 1.0.4 — 2019-03-06
- 1.0.3 — 2019-03-06
- 1.0.2 — 2019-02-12
- 1.0.1 — 2019-02-12
- 1.0.0 — 2019-02-12

## README

![npm badge](https://img.shields.io/npm/v/vue-keen-tracking.svg?style=flat)

Vue plugin built on [keen-tracking.js](https://github.com/keen/keen-tracking.js).

## Install
```
npm install vue-keen-tracking --save
```

```
import VueKeen from "vue-keen-tracking";

const keenOptions = {
  projectId: "<KEEN_PROJECT_ID>",
  writeKey: "<KEEN_WRITE_KEY>"
};

Vue.use(VueKeen, keenOptions);
```

You can then access the KeenTracking object through `this.$keen` in any of your components/views.

You can add `autoTracking: true` to the config to add Keens auto-tracking.

### Vue-Router and Vuex

To track events from `vue-router` or `vuex`, extend your config with this:

```
import VueRouter from "vue-router";
import Vuex from "vuex";

Vue.use(Vuex);
Vue.use(VueRouter);

const router = require("./router");
const store = require("./store");

const keenOptions = {
  projectId: "<KEEN_PROJECT_ID>",
  writeKey: "<KEEN_WRITE_KEY>",
  trackRoutes: {
    router: router
  },
  trackVuex: {
    store: store,
    mutations: true,
    actions: true
  }
};
```

### Extend event properties

[API reference](https://github.com/keen/keen-tracking.js/blob/master/docs/extend-events.md)

```
const user = await fetchUser();
this.\$keen.extendEvents({
user
})
```

### Record an event

[API reference](https://github.com/keen/keen-tracking.js/blob/master/docs/record-events.md)

```
this.\$keen.recordEvent("purchases", {
  item: "avocado"
});
```

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