@get-base/vue-segment
v0.3.5
Published
Vue.js plugin for Segment Analytics.js
Downloads
3
Readme
NOT MAINTAINED ANYMORE!
We don't use segment anymore for our website, I don't have an account on Segment to make this plugin evolve.
Please fill in an issue if you want to be a maintainer or if you want redirect people to you fork.
vue-segment
Vue.js plugin for Segment Analytics.js
Segment Analytics.js Documentation
Setup
- Add the
@dansmaculotte/vue-segment
dependency withyarn
ornpm
to your project - Configure it:
import Vue from 'vue'
import Segment from '@dansmaculotte/vue-segment'
Vue.use(Segment, {
writeKey: 'YOUR_SEGMENT_WRITE_KEY',
disabled: true,
router,
pageCategory: 'shop',
settings: {
...
}
})
Usage
See Segment Vue Quickstart Guide.
Options
writeKey
- Type:
String
- Default:
''
- Default:
disabled
Disable automatic script loading, if you need compliance with GDPR.
- Type:
Boolean
- Default:
false
- Default:
router
Call analytics.page
method on afterEach
router method if provided.
- Type:
Object
pageCategory
In case you provided router, you can specify the category page of the page
event. See segment page method reference.
- Type:
String
,- Default:
''
- Default:
settings
See Load options reference.
- Type:
Object
Development
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
npm run dev