Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
nuxt-umami
Advanced tools
Deeply integrate Umami Analytics into your Nuxt websites / applications.
Heads up: This version uses features (Nuxt Layers) that are only available in Nuxt 3. Check out Nuxt Umami v1 for Nuxt 2 compat.
Install using your favorite package manager...
pnpm add nuxt-umami@next #pnpm
npm install nuxt-umami@next #npm
Then add nuxt-umami
to your extends
array in nuxt.config
:
defineNuxtConfig({
extends: ['nuxt-umami']
});
Or, you can totally skip the installation process and do
defineNuxtConfig({
extends: ['github:ijkml/nuxt-umami#next']
});
Warning: This might cause unwanted errors due to changes as the branch is still WIP.
You can provide configuration options using the app.config.ts
file or appConfig
property of the Nuxt config.
app.config.ts
file(recommended for readability and ease of update)
export default defineAppConfig({
umami: {
// ...umami config here
},
});
appConfig
propertydefineNuxtConfig({
extends: ['nuxt-umami@next'],
appConfig: {
umami: {
// ...umami config here
},
},
});
Use it?
option | type | description | required | default |
---|---|---|---|---|
host | string | Your Umami endpoint. This is where your script is hosted. Eg: https://ijkml.xyz/ . | true | '' |
id | string | Unique website-id provided by Umami. | true | '' |
domains | string | Limit tracker to specific domains by providing a comma-separated list (without 'http'). Leave blank for all domains. | false | '' |
ignoreDnt | boolean | Option to ignore browsers' Do Not Track setting. | false | true |
autoTrack | boolean | Option to automatically track page views. | false | true |
ignoreLocalhost | boolean | Option to prevent tracking on localhost. | false | false |
Two functions are auto-imported, umTrackView()
and umTrackEvent()
. Use them however and wherever you like.
umTrackView(url, referrer)
url
: the path being tracked, eg /about
, /contact?by=phone#office
. Most times, this can be correctly inferred. Equivalent of router.fullPath
.referrer
: the page referrer. Most times, this can be correctly inferred. Equivalent of document.referrer
.umTrackEvent(eventName, eventData)
eventName
: a string type texteventData
: could be string, number, array or objectReference: Umami Tracker Functions.
Open an issue, fire a PR. Contributions are welcome! If you encounter any issues, don't hesitate to open an issue. I'm always available to help and resolve any bugs.
FAQs
Integrate Umami Analytics into Nuxt
The npm package nuxt-umami receives a total of 2,153 weekly downloads. As such, nuxt-umami popularity was classified as popular.
We found that nuxt-umami demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.