PostHog / posthog
PostHog / posthog
PostHog is the open source platform for building self-driving products. PostHog provides every tool you need to build a successful product, and captures all the context agents need to proactively diagnose problems, uncover opportunities, and ship fixes: PostHog 是一个用于构建“自动驾驶”产品的开源平台。PostHog 提供了构建成功产品所需的一切工具,并捕获了智能体(Agents)主动诊断问题、发现机会和发布修复程序所需的所有上下文:
- Self-driving mode: Turn signals in your product data (errors, rage clicks, failed queries, and more) into researched reports and pull requests you review and merge. 自动驾驶模式: 将产品数据中的信号(错误、愤怒点击、失败的查询等)转化为经过研究的报告和你可以审核并合并的 Pull Request。
- Product analytics: Autocapture or manually instrument event-based analytics to understand user behavior and analyze data with visualization or SQL. 产品分析: 通过自动捕获或手动埋点进行基于事件的分析,以了解用户行为,并使用可视化或 SQL 分析数据。
- Web analytics: Monitor web traffic and user sessions with a GA-like dashboard. Easily monitor conversion, web vitals, and revenue. 网站分析: 使用类似 GA 的仪表板监控网站流量和用户会话。轻松监控转化率、Web Vitals 和收入。
- Session replays: Watch real user sessions of interactions with your website or mobile app to diagnose issues and understand user behavior. 会话回放: 观看真实用户与你的网站或移动应用的交互会话,以诊断问题并了解用户行为。
- Feature flags: Safely roll out features to select users or cohorts with feature flags. 功能标志(Feature flags): 使用功能标志安全地向特定用户或群体发布功能。
- Experiments: Test changes and measure their statistical impact on goal metrics. Set up experiments with no-code too. 实验: 测试变更并衡量其对目标指标的统计影响。也可以通过无代码方式设置实验。
- Error tracking: Track errors, get alerts, and resolve issues to improve your product. 错误追踪: 追踪错误、获取警报并解决问题,以改进你的产品。
- Logs: Ingest, search, and analyze log data alongside the rest of your product data. 日志: 在处理其他产品数据的同时,摄取、搜索和分析日志数据。
- Surveys: Ask anything with our collection of no-code survey templates, or build custom surveys with our survey builder. 问卷调查: 使用我们收集的无代码问卷模板询问任何问题,或使用我们的问卷构建器创建自定义问卷。
- Data warehouse: Sync data from external tools like Stripe, Hubspot, your data warehouse, and more. Query it alongside your product data. 数据仓库: 从 Stripe、Hubspot、你的数据仓库等外部工具同步数据,并将其与你的产品数据一起查询。
- Data pipelines: Run custom filters and transformations on your incoming data. Send it to 25+ tools or any webhook in real time or batch export large amounts to your warehouse. 数据管道: 对传入的数据运行自定义过滤器和转换。实时发送到 25+ 个工具或任何 Webhook,或批量导出大量数据到你的仓库。
- AI observability: Capture traces, generations, latency, and cost for your LLM-powered app. AI 可观测性: 为你的 LLM(大语言模型)驱动的应用捕获追踪、生成、延迟和成本数据。
- Workflows: Create workflows that automate actions or send messages to your users. You can steer it all from Slack, web, desktop (PostHog Code), or your own editor via the MCP. 工作流: 创建自动化操作或向用户发送消息的工作流。你可以通过 Slack、Web、桌面端(PostHog Code)或通过 MCP 在你自己的编辑器中控制这一切。
Best of all, all of this is free to use with a generous monthly free tier for each tool. Get started by signing up for PostHog Cloud US or PostHog Cloud EU. 最棒的是,所有这些工具都可以免费使用,并且每个工具都有慷慨的每月免费额度。请注册 PostHog Cloud US 或 PostHog Cloud EU 开始使用。
Getting started with PostHog
开始使用 PostHog
PostHog Cloud (Recommended) PostHog Cloud(推荐)
The fastest and most reliable way to get started with PostHog is signing up for free to PostHog Cloud or PostHog Cloud EU. Your first 1 million events, 5k recordings, 1M flag requests, 100k exceptions, and 1500 survey responses are free every month, after which you pay based on usage. 开始使用 PostHog 最快且最可靠的方法是免费注册 PostHog Cloud 或 PostHog Cloud EU。每月前 100 万次事件、5000 次录制、100 万次标志请求、10 万次异常和 1500 次问卷回复是免费的,超出部分按使用量付费。
Self-hosting the open-source hobby deploy (Advanced) 自托管开源爱好版部署(进阶)
If you want to self-host PostHog, you can deploy a hobby instance in one line on Linux with Docker (recommended 4GB memory): 如果你想自托管 PostHog,可以在 Linux 上使用 Docker 一行命令部署一个爱好版实例(建议 4GB 内存):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)"
Open source deployments should scale to approximately 100k events per month, after which we recommend migrating to a PostHog Cloud. We do not provide customer support or offer guarantees for open source deployments. See our self-hosting docs, troubleshooting guide, and disclaimer for more info. 开源部署的规模约为每月 10 万次事件,超过此规模后,我们建议迁移到 PostHog Cloud。我们不为开源部署提供客户支持或保证。更多信息请参阅我们的自托管文档、故障排除指南和免责声明。
Setting up PostHog
设置 PostHog
Once you’ve got a PostHog instance, you can set it up by installing our JavaScript web snippet, one of our SDKs, or by using our API. You can also connect the MCP to bring PostHog into Claude Code, Cursor, or any MCP-compatible agent. 一旦你拥有了 PostHog 实例,可以通过安装我们的 JavaScript Web 代码片段、SDK 之一或使用我们的 API 来进行设置。你还可以连接 MCP,将 PostHog 引入 Claude Code、Cursor 或任何兼容 MCP 的智能体中。
We have SDKs and libraries for popular languages and frameworks like: 我们为流行的语言和框架提供了 SDK 和库,例如:
- Frontend: JavaScript, React, Next.js, Vue
- 前端: JavaScript, React, Next.js, Vue
- Mobile: React Native, Android, iOS, Flutter
- 移动端: React Native, Android, iOS, Flutter
- Backend: Python, Node, PHP, Ruby
- 后端: Python, Node, PHP, Ruby
Beyond this, we have docs and guides for Go, .NET/C#, Django, Angular, WordPress, Webflow, and more. Once you’ve installed PostHog, see our product docs for more information on how to set up product analytics, web analytics, session replays, feature flags, experiments, error tracking, surveys, data warehouse, and more. 此外,我们还有针对 Go、.NET/C#、Django、Angular、WordPress、Webflow 等的文档和指南。安装 PostHog 后,请参阅我们的产品文档,了解有关如何设置产品分析、网站分析、会话回放、功能标志、实验、错误追踪、问卷调查、数据仓库等的更多信息。
Learning more about PostHog
了解更多关于 PostHog 的信息
Our code isn’t the only thing that’s open source 😳. We also open source our company handbook which details our strategy, ways of working, and processes. Curious about how to make the most of PostHog? We wrote a guide to winning with PostHog which walks you through the basics of measuring activation, tracking retention, and capturing revenue. 我们的代码并不是唯一开源的东西 😳。我们还开源了公司手册,详细介绍了我们的战略、工作方式和流程。想知道如何充分利用 PostHog 吗?我们编写了一份《PostHog 成功指南》,带你了解衡量激活、追踪留存和获取收入的基础知识。
Contributing
贡献
We <3 contributions big and small: 我们热爱大大小小的贡献:
- Vote on features or get early access to beta functionality in our roadmap. 在我们的路线图中为功能投票或抢先体验 Beta 功能。
- Open a PR (see our instructions on developing PostHog locally). 提交 PR(请参阅我们在本地开发 PostHog 的说明)。
- Submit a feature request or bug report. 提交功能请求或错误报告。
- For an overview of the codebase structure, see monorepo layout and products. 有关代码库结构的概述,请参阅 monorepo 布局和产品说明。
Open-source vs. paid
开源与付费
This repo is available under the MIT expat license, except for the ee directory (which has its license here) if applicable. Need absolutely 💯% FOSS? Check out our posthog-foss repository, which is purged of all proprietary code and features. The pricing for our paid plan is completely transparent and available on our pricing page. 本仓库在 MIT expat 许可下提供,ee 目录除外(其许可在此处,如适用)。需要 100% 的自由开源软件(FOSS)?请查看我们的 posthog-foss 仓库,其中已清除所有专有代码和功能。我们付费计划的定价完全透明,可在我们的定价页面上查看。
We’re hiring!
我们正在招聘!
Hey! If you’re reading this, you’ve proven yourself as a dedicated README reader. You might also make a great addition to our team. We’re growing fast and would love for you to join us. 嘿!如果你读到这里,说明你是一位专注的 README 阅读者。你可能也会成为我们团队的重要一员。我们正在快速成长,非常期待你的加入。