Nuxt web analytics installation
- Install
posthog-jsusing your package manager:
- Add your PostHog API key and host to your
nuxt.config.jsfile. You can find these in your project settings.
nuxt.config.js
- Create a new plugin by creating a new file
posthog.client.jsin your plugins directory.
plugins/posthog.client.js
Next steps
After installing PostHog and ensuring autocapture is enabled, head to your web analytics dashboard to see your data. And then check out our getting started guide.
PostHog tip: Web analytics works with anonymous events. This means if you are primarily using PostHog for web analytics, it can be significantly cheaper for you.