WordPress web analytics installation
Install a header/footer script plugin like WPCode or similar. Go to the plugin settings and add a new header script with the following code: Save and activate the script. Add the same code snippet to your theme's See the WordPress integration docs for more details. 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: See the WordPress integration docs for more details on tracking events. 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.Install via plugin (recommended)
RequiredAlternative: Edit theme directly
header.php file, just before the closing </head> tag. Note: this may be overwritten when updating themes.Send events
RecommendedNext steps
Recommended