Google Tag Manager web analytics installation
Get your PostHog snippet with your project API key and instance address from your project settings.
Assuming you have already set up Google Tag Manager, go to your dashboard and navigate to the desired account/container that is integrated with the website you want to add PostHog tracking to.
Click to add a new tag:

Under Tag Configuration, choose Custom HTML and add your PostHog snippet.

For the trigger, select the default All Pages - Page View trigger and then click Save.
Back on the main dashboard, click Submit to update your website with the new PostHog tag.
You're done! PostHog is now added to your site and autocapturing data like pageviews and clicks.
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.