|
| 1 | +<img src="/counter.svg" alt="Counter Analytics" height="100" /> |
| 2 | + |
| 3 | +# Counter Analytics Vue 3 integration |
| 4 | + |
| 5 | +[](https://www.npmjs.com/package/counter-analytics-vue) |
| 6 | +[](https://github.com/ansidev/counter-analytics-vue/actions/workflows/publish.yml) |
| 7 | +[](https://sourcegraph.com/github.com/ansidev/counter-analytics-vue?badge) |
| 8 | +[](https://app.netlify.com/sites/counter-analytics-vue/deploys) |
| 9 | + |
| 10 | +Unofficial [Counter Analytics](https://go2.vn/dr9ng) integration for Vue.js. |
| 11 | + |
| 12 | +## Integration |
| 13 | + |
| 14 | +### Install |
| 15 | + |
| 16 | +Run the following command to install in your project: |
| 17 | + |
| 18 | +``` |
| 19 | +npm install counter-analytics-vue |
| 20 | +``` |
| 21 | + |
| 22 | +Or with yarn: |
| 23 | + |
| 24 | +``` |
| 25 | +yarn add counter-analytics-vue |
| 26 | +``` |
| 27 | + |
| 28 | +Or with pnpm: |
| 29 | + |
| 30 | +``` |
| 31 | +pnpm add counter-analytics-vue |
| 32 | +``` |
| 33 | + |
| 34 | +### Basic usage |
| 35 | + |
| 36 | +You can now import, and use the Counter Analytics hook on your project: |
| 37 | + |
| 38 | +```typescript |
| 39 | +// ./src/main.ts |
| 40 | + |
| 41 | +import { createApp } from 'vue' |
| 42 | +import CounterAnalytics from 'counter-analytics-vue' |
| 43 | + |
| 44 | +const app = createApp({}) |
| 45 | + |
| 46 | +app.use(CounterAnalytics, { |
| 47 | + id: 'COUNTER_ANALYTICS_ID', |
| 48 | + utcOffset: 0, |
| 49 | +}) |
| 50 | +``` |
| 51 | + |
| 52 | +### Advanced options |
| 53 | +You can use `useCounterAnalytics` hook, it accepts an option object as the parameter. |
| 54 | + |
| 55 | +You can always [create an issue](https://github.com/ansidev/counter-analytics-vue/issues/new) in case of any questions! 😀 |
| 56 | + |
| 57 | +## Contribution |
| 58 | + |
| 59 | +Feel free to contribute to the source code by opening a pull requests. |
| 60 | + |
| 61 | +For any questions, you can [open an issue](https://github.com/ansidev/counter-analytics-vue/issues/new), refer to the official [Counter project](https://github.com/ihucos/counter.dev) or reach them at `hey@counter.dev`. |
| 62 | + |
| 63 | +## Donate |
| 64 | + |
| 65 | +You can support this project by donating me at: |
| 66 | +- [Paypal](https://paypal.me/ansidev) |
| 67 | +- [Ko-fi](https://ko-fi.com/ansidev) |
| 68 | +- [Buy me a coffee](https://buymeacoffee.com/ansidev) |
| 69 | + |
| 70 | +## License |
| 71 | + |
| 72 | +This source code is available under the [MIT LICENSE](/LICENSE). |
0 commit comments