Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fengyuanchen/vue-countly
Countly plugin for Vue.js.
https://github.com/fengyuanchen/vue-countly
countly vue vue-plugin vuejs
Last synced: about 2 months ago
JSON representation
Countly plugin for Vue.js.
- Host: GitHub
- URL: https://github.com/fengyuanchen/vue-countly
- Owner: fengyuanchen
- License: mit
- Created: 2019-01-23T06:23:17.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-02-19T05:32:19.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T00:04:51.435Z (about 2 months ago)
- Topics: countly, vue, vue-plugin, vuejs
- Language: JavaScript
- Size: 395 KB
- Stars: 11
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# vue-countly
[![Coverage Status](https://img.shields.io/codecov/c/github/fengyuanchen/vue-countly.svg)](https://codecov.io/gh/fengyuanchen/vue-countly) [![Downloads](https://img.shields.io/npm/dm/vue-countly.svg)](https://www.npmjs.com/package/vue-countly) [![Version](https://img.shields.io/npm/v/vue-countly.svg)](https://www.npmjs.com/package/vue-countly) [![Gzip Size](https://img.shields.io/bundlephobia/minzip/vue-countly.svg)](https://unpkg.com/vue-countly/dist/vue-countly.js)
> [Countly](https://resources.count.ly/docs/countly-sdk-for-web) plugin for Vue 3. For Vue 2, check out the [`v1`](https://github.com/fengyuanchen/vue-countly/tree/v1) branch.
## Main npm package files
```text
dist/
├── vue-countly.js (UMD, default)
├── vue-countly.min.js (UMD, compressed)
├── vue-countly.esm.js (ECMAScript Module)
├── vue-countly.esm.min.js (ECMAScript Module, compressed)
└── vue-countly.d.ts (TypeScript Declaration File)
```## Getting started
### Installation
Using npm:
```shell
npm install vue@3 countly-sdk-web@21 vue-countly@2
```Using pnpm:
```shell
pnpm add vue@3 countly-sdk-web@21 vue-countly@2
```Using Yarn:
```shell
yarn add vue@3 countly-sdk-web@21 vue-countly@2
```Using CDN:
```html
```
### Usage
```js
import { createApp, defineComponent } from 'vue';
import Countly from 'countly-sdk-web';
import VueCountly from 'vue-countly';const app = createApp({
created() {
console.log(this.$Countly === Countly);
// > true// Track sessions automatically (recommended)
this.$Countly.q.push(['track_sessions']);// Track web page views automatically (recommended)
this.$Countly.q.push(['track_pageview']);
},
});// Inject the `$Countly` property into all components within the application.
app.use(VueCountly, Countly, {
app_key: 'YOUR_APP_KEY',
url: 'https://yourdomain.com/',
});
app.mount(document.body);
```> See the available [initialization config options](https://support.count.ly/hc/en-us/articles/360037441932-Web-analytics-JavaScript-#setup-properties) of Countly.
## Browser support
Same as Vue 3.
## Versioning
Maintained under the [Semantic Versioning guidelines](https://semver.org/).
## License
[MIT](https://opensource.org/licenses/MIT) © [Chen Fengyuan](https://chenfengyuan.com/)