Web analytics

Last updated:

|Edit this page

Web analytics enables you to easily track and monitor many of the most important metrics for your website.

Unlike product analytics, web analytics offers a more streamlined and focused experience. This is especially useful for marketers, content creators, or anyone used to tools like Google Analytics. It includes a dashboard that offers essential metrics, such as visitors, views, sessions, session duration, bounce rate, paths, referrers, and more.

Web analytics

Get started with web analytics

Getting started is a simple three-step process.

1. Install PostHog on your website

Follow the installation instructions to setup either the JavaScript snippet or the JavaScript Web SDK for the website you want to track.

Web analytics works with anonymous events. This means if you are primarily using PostHog for web analytics, it can be significantly cheaper for you.

To capture anonymous events, set your JavaScript Web person_profiles config option to identified_only like this:

Web
posthog.init(
'<ph_project_api_key>',
{
api_host: 'https://us.i.posthog.com',
person_profiles: 'identified_only'
}
)

Single-page apps might require you to manually implement $pageview and $pageleave event capture for every navigation change. See our tutorials on how to do this in React, Next.js, Vue, and Svelte.

2. Go to the web analytics dashboard

Now, you can click the newly added web analytics tab to go to the dashboard.

Questions?

Was this page useful?

Next article

Web analytics dashboard

The web analytics dashboard provides an overview of your website's traffic. For the selected time range, it starts with the number of visitors, views, sessions, along with trends for each, as well as average session duration and bounce rate. Each of these is compared with the previous time range, showing how much they increased or decreased. Bounce rate A bounce is a session where the user only had one pageview, no autocaptures, and spent less than 30 seconds on the page. Your bounce rate is…

Read next article