Web product analytics installation
- 1
Install the package
RequiredInstall the PostHog JavaScript library using your package manager:
- 2
Initialize PostHog
RequiredImport and initialize the PostHog library with your project API key and host:
JavaScript - 3
Send events
Click around and view a couple pages to generate some events. PostHog automatically captures pageviews, clicks, and other interactions for you.
If you'd like, you can also manually capture custom events:
JavaScriptBy default, for backwards compatibility reasons, events are sent with person profile processing enabled. This means a person profile will be created for each user who triggers an event.
If you want to disable person profile processing for certain events, send the event with the following property:
Javascript