NuxtJS module for Stripe.js
This module uses vue-segment-analytics to add Segment Analytics to a Nuxt.js app. You can make called with this.$analytics.track()
- Add
nuxt-segment-analytics
dependency using yarn or npm to your project - Add
nuxt-segment-analytics
tomodules
section ofnuxt.config.js
{
modules: [
// Simple usage
'nuxt-segment-analytics',
// With options
['nuxt-segment-analytics', { id: "SEGMENT_KEY", useRouter: true }],
]
}
export default {
mounted () {
this.$analytics.identify('f4ca124298', {
name: 'Michael Bolton',
email: 'mbolton@initech.com'
})
this.$analytics.track('Signed Up', { plan: 'Enterprise' })
this.$analytics.page('Pricing');
}
}
- Clone this repository
- Install dependencies using
yarn install
ornpm install
- Start development server using
npm run dev
Copyright (c) Dylan Wight dylan@otechie.com