PostHog

PostHog is an open-source product analytics platform that helps you understand your users' behavior and improve your website or application.

Filter out Netlify bot events

Netlify uses bots to deploy builds. These bots fire analytics events that pollute production data. Before analyzing events, filter out events from URLs containing:

  • localhost
  • dev.netlify.app

For example, this regex will filter out local host variations.

^(localhost|127\.0\.0\.1)($|:)

Capture PostHog events

When capturing events via library, you may write to "reserved" PostHog events and properties, which start with a $.

posthog.capture(user_id, "$pageview", {"$current_url": "https://example.com"})

Resources

PostHog
Interactive graph
On this page
Filter out Netlify bot events
Capture PostHog events
Resources