Back to docs

Analytics providers in web-nuxt

Optional analytics support for GA4, Plausible, and Microsoft Clarity.

web-nuxt now supports optional global analytics providers from zship.app.json.

Supported providers

  • Google Analytics 4 via analytics.googleAnalytics.measurementId
  • Plausible via analytics.plausible.domain
  • Microsoft Clarity via analytics.clarity.projectId

Analytics scripts are no longer injected unconditionally. The app now waits for a consent decision before loading those providers.

  • Consent is persisted with a cookie plus local storage
  • A shared useAnalytics() wrapper exposes track() and page-view tracking
  • You can extend the same layer later for region-aware consent or first-party proxying
{
  "analytics": {
    "googleAnalytics": {
      "measurementId": "G-XXXXXXXXXX"
    },
    "plausible": {
      "domain": "nuxt.zship.ai",
      "scriptSrc": "",
      "apiEndpoint": ""
    },
    "clarity": {
      "projectId": "your-clarity-project-id"
    }
  }
}

Next improvement path

If you need stricter compliance, add a dedicated consent center or route analytics through first-party endpoints before turning on provider IDs in production.