Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vchaptsev/vue-yandex-metrika
Vue plugin for Yandex Metrika
https://github.com/vchaptsev/vue-yandex-metrika
vue yandex yandex-metrika
Last synced: 26 days ago
JSON representation
Vue plugin for Yandex Metrika
- Host: GitHub
- URL: https://github.com/vchaptsev/vue-yandex-metrika
- Owner: vchaptsev
- License: mit
- Created: 2017-12-04T01:03:46.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-03T15:00:10.000Z (over 4 years ago)
- Last Synced: 2024-01-08T08:50:56.542Z (5 months ago)
- Topics: vue, yandex, yandex-metrika
- Language: JavaScript
- Size: 42 KB
- Stars: 73
- Watchers: 4
- Forks: 33
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by [@vchaptsev](https://github.com/vchaptsev/) (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by [@vchaptsev](https://github.com/vchaptsev/) (Components & Libraries / Integrations)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by [@vchaptsev](https://github.com/vchaptsev/) (Integrations / Vue CLI 3 Plugins)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by [@vchaptsev](https://github.com/vchaptsev/) (Integrations / Vue CLI 3 Plugins)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by [@vchaptsev](https://github.com/vchaptsev/) (Integrations / Payment)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by ([@vchaptsev](https://github.com/vchaptsev/)) (Integrations / Payment)
- awesome-vue. - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by ([@vchaptsev](https://github.com/vchaptsev/)) (Integrations / Payment)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options by ([@vchaptsev](https://github.com/vchaptsev/)) (Integrations / Payment)
- awesome-vue - vue-yandex-metrika ★26 - Vue plugin for Yandex Metrika with router integration, plugin options by [@vchaptsev](https://github.com/vchaptsev/) (Integrations / Vue CLI 3 Plugins)
- awesome-vue - vue-yandex-metrika - Vue plugin for Yandex Metrika with router integration, plugin options (Components & Libraries / Integrations)
README
# Vue Yandex Metrika
**vue-yandex-metrika** allows you to send data about visited pages to [Yandex Metrika].
## Installation
Install with [yarn]:
```bash
$ yarn add vue-yandex-metrika
```Install with [npm]:
```bash
$ npm install vue-yandex-metrika --save
```## Ways to use
### Autotracking
Pass the` VueRouter` instance to the plugin and let it handle everything for you ([Metrika API] is also available):
```javascript
// your main.js
import Vue from 'vue'
import VueRouter from 'vue-router'
import VueYandexMetrika from 'vue-yandex-metrika'const router = new VueRouter({...}) // your routes
Vue.use(VueYandexMetrika, {
id: XXXXXXXX,
router: router,
env: process.env.NODE_ENV
// other options
})
```### Manual tracking
Works without router: [Metrika API]
```javascript
// your main.js
import Vue from 'vue'
import VueYandexMetrika from 'vue-yandex-metrika'Vue.use(VueYandexMetrika, {
id: XXXXXXXX,
env: process.env.NODE_ENV
// other options
})
```
___```javascript
// your code
this.$metrika.hit(path)
```#### Options:
| Name | Description | Required | Default |
| -------------- | ------------------------------------------------------------------------------------------------------- | -------- | ---------------------------------------------------------- |
| id | Your tracking `id` | True | null |
| router | [Autotracking](#autotracking) if the `router` is passed, otherwise: [manual tracking](#manual-tracking) | False | null |
| env | API calls are performed only if `env` is "production" | False | development |
| scriptSrc | Src of metrika script to use | False | https://mc.yandex.ru/metrika/tag.js |
| debug | If `env` is not "production" and `debug` is true: API calls are replaced by `console.log()` | False | false |
| ignoreRoutes | List of ignored routes names | False | [] |
| skipSamePath | Do not track a page visit if previous and next routes URLs match | False | true |
| options | Original Yandex Metrika [options](https://yandex.ru/support/metrika/code/counter-initialize.html) | False | {clickmap:true, trackLinks:true, accurateTrackBounce:true} |[Yandex Metrika]: https://metrika.yandex.ru
[yarn]: https://yarnpkg.com
[npm]: https://npmjs.com
[Metrika API]: https://yandex.ru/support/metrika/objects/method-reference.html