{{ text }}
{{ text }}
Please support us by disabling your ad blocker.
localStorage for user IDs, which persists across sessions until manually cleared. Includes CWV collection.
selfHosting: Open-source and self-hostable.
bestFor: Teams that want self-hosted analytics with Core Web Vitals built in.
```
::
## Databuddy Analytics Review
:LinkScript{slug="databuddyAnalytics"} touches the most APIs at **8**: `localStorage`{lang="ts"}, `sessionStorage`{lang="ts"}, `performanceObserver`{lang="ts"}, `screen`{lang="ts"}, `languages`{lang="ts"}, `userAgent`{lang="ts"}, `sendBeacon`{lang="ts"}, and `fetch`{lang="ts"}.
::analytics-review
```yaml [props]
scriptKey: databuddyAnalytics
privacy: Cookie-free. Uses both localStorage and sessionStorage for state. Broader device signal collection than other privacy-first tools, but no fingerprinting APIs.
selfHosting: Open-source and self-hostable.
bestFor: Teams that want the most device context possible while staying cookie-free.
```
::
## Vercel Analytics Review
:LinkScript{slug="vercelAnalytics"} is the most minimal option, touching **2 APIs**: `userAgent`{lang="ts"} (device classification) and `fetch`{lang="ts"}.
::analytics-review
```yaml [props]
scriptKey: vercelAnalytics
privacy: Cookie-free by default. Minimal data collection - no localStorage, no session state. An opt-in enableCookie flag exists but defaults to off.
selfHosting: No (tied to Vercel platform).
bestFor: Vercel-hosted apps that want zero-config analytics with the absolute smallest footprint.
```
::
## Performance Comparison: All 7 Privacy-First Analytics Tools
Fewer APIs and smaller scripts translate directly to less main-thread work:
::privacy-performance-table
::
Every privacy-first analytics provider stays under **2ms of script execution** and **10ms of task duration**.
The three providers that collect Core Web Vitals (Cloudflare, Rybbit, Databuddy) carry larger decoded sizes (25โ30 KB) because the `performanceObserver`{lang="ts"} integration adds measurement code. That's a reasonable tradeoff if you want CWV data without a separate monitoring tool.
## GDPR Compliance: Why Cookie-Free Analytics Win in 2026
### The Consent Banner Problem
EU cookie acceptance rates dropped to [40โ58% across member states](https://www.cnil.fr/en/cookies-and-other-tracking-devices-how-do-i-comply-with-the-rules) in 2026 (CNIL guidance, February 2026). Cookie-based analytics like GA4 and default Matomo lose 40โ60% of their traffic data to "Reject All" clicks. All seven privacy-first analytics tools in this comparison capture close to 100%.
::chart-consent-impact
::
### Matomo's CNIL Exemption
[Matomo is the only analytics platform](https://www.cnil.fr/en/cookies-and-other-tracking-devices) with a formal consent exemption from France's data protection authority. The exemption requires IP masking, 13-month cookie caps, and no third-party data sharing. However, Matomo's default configuration uses cookies - you must explicitly configure cookie-free mode to qualify.
## First-Party Mode: Recovering Ad-Blocked Data
25โ45% of users block trackers ([Blockthrough Ad-Block Report 2026](https://blockthrough.com)). Even privacy-first scripts hosted on known domains (`plausible.io`, `cloud.umami.is`) get blocked at the DNS level.
Nuxt Scripts' first-party mode proxies analytics traffic through your own domain:
```ts
// nuxt.config.ts
export default defineNuxtConfig({
scripts: {
registry: {
plausibleAnalytics: {
domain: 'yourdomain.com'
}
}
}
})
```
Requests go to `yourdomain.com/_scripts/plausible` instead of `plausible.io/js/script.js`. Indistinguishable from a first-party request to most blockers. Data accuracy returns to near 100%.
## Which Privacy-First Analytics Tool Should You Choose?
::privacy-picker-table
::
For most apps: **start with :LinkScript{slug="plausibleAnalytics"}, :LinkScript{slug="fathomAnalytics"}, or :LinkScript{slug="vercelAnalytics"}**. Add :LinkScript{slug="cloudflareWebAnalytics"} or :LinkScript{slug="rybbitAnalytics"} if you need Core Web Vitals. Only reach for GA4 or Matomo if you need specific features that privacy-first analytics tools don't offer.
---
**Last reviewed:** March 2026
### Related Resources
- [Analytics Script Performance Comparison](/learn/analytics-script-performance)
- [Choosing the Right Analytics for Nuxt](/learn/choosing-analytics-nuxt)
- [Nuxt Scripts Documentation](/docs/getting-started)
---
- **Page:** useScript
- **Source:** https://scripts.nuxt.com/docs/v0/api/use-script
- **Description:** API documentation for the useScript function.
This composable is a wrapper around the Unhead [useScript](https://unhead.unjs.io/usage/composables/use-script) with extra Nuxt goodies on top, for
full documentation please refer to this.
## Signature
```ts
export function useScriptPlease support us by disabling your ad blocker.