2.0.2 • Published 9 months ago
@openmost/nuxt-matomo v2.0.2
Matomo for Nuxt
Quick Setup
- Add
@openmost/nuxt-matomodependency to your project
# Using pnpm
pnpm add -D @openmost/nuxt-matomo
# Using yarn
yarn add --dev @openmost/nuxt-matomo
# Using npm
npm install --save-dev @openmost/nuxt-matomo- Add
@openmost/nuxt-matomoto themodulessection ofnuxt.config.ts
export default defineNuxtConfig({
modules: [
'@openmost/nuxt-matomo'
]
})Config
Register config in the matomo section to your nuxt.config.ts:
runtimeConfig: {
public: {
matomo: {
host: 'https://matomo.example.com',
containerId: 'xxxxxxxx',
},
},
}You can also use variables with your .env file:
NUXT_PUBLIC_MATOMO_HOST=https://matomo.example.com
NUXT_PUBLIC_MATOMO_CONTAINER_ID=xxxxxxxx
NUXT_PUBLIC_MATOMO_SITE_ID=1