PostHog Integration: Add PostHog to Your Site
PostHog
PostHog adds product analytics, session replay and feature flags to a We.Inc site or web app through one JavaScript snippet.
Use Case
Where PostHog fits on a We.Inc app
PostHog is an open source product analytics platform. Its JavaScript library captures events and pageviews, records sessions for replay, and evaluates feature flags, all tied to a project in your PostHog account.
We.Inc's Analytics panel already gives you visitor and pageview stats with no tag. PostHog is worth adding when you are building a web app with sign-ups and want to follow users through steps: funnels from landing page to account creation, retention, or turning a new feature on for some users only with a flag.
The snippet is a script block you get from PostHog's docs, with your project token from project settings filled in. Because We.Inc projects are real React code, the AI can also call PostHog functions such as identifying a signed-in user or checking a flag, once the snippet is on the page.
Funnels and events
Custom events sit beside automatic pageviews so you can measure each step of a sign-up flow.
Feature flags
The library exposes functions to check whether a flag is on for the current user.
Session replay
Recordings load on demand from PostHog's CDN when replay is enabled for the project.
Monthly free allowance
PostHog's pricing lists 1M events, 5K recordings and 1M flag requests free each month.
Setup Guide
How to integrate PostHog.
Snippet through the We.Inc chat
Fastest way to get events flowing site-wide.
Step-by-step guide
- 1
Create a PostHog project and open its project settings to find your project token.
- 2
Copy the HTML snippet from PostHog's JavaScript web docs and put your token in place of the placeholder.
- 3
Check the api_host in the snippet matches your PostHog cloud region.
- 4
Paste the finished snippet into the We.Inc chat and ask for it in the head of every page.
- 5
Publish, then open the live site and click around.
- 6
Look for your pageviews in PostHog's activity view to confirm events arrive.
Identify signed-in users in a web app
For apps using We.Inc's Cloud sign-up and login.
Step-by-step guide
- 1
Install the snippet as above and confirm anonymous events arrive.
- 2
Ask the We.Inc chat to call PostHog's identify function with the user's ID after login.
- 3
Ask for a reset call on logout so the next person is not linked to the previous account.
- 4
Publish and sign in with a test account.
- 5
Confirm in PostHog that the test person shows the right ID.
Free allowances and billing limits, as of October 2026
PostHog's pricing page leads with a free tier that resets monthly: 1M product analytics events, 5K session recordings and 1M feature flag requests, with no rollover. Above that, each product is billed per unit. In billing settings you can set a dollar limit per product; PostHog's docs warn that once a limit is reached, further data for that product is dropped and cannot be recovered.
Content security policy and replay
PostHog's docs note that the replay recorder is fetched from its CDN when needed, and a strict Content-Security-Policy must allow PostHog's domains, including worker-src, or events can fail without any error. If you or the AI added a CSP to your We.Inc project, ask for PostHog's domains to be allowed.
Consent before tracking
Product analytics with identified users and replays is personal data. For EU or UK visitors, ask the We.Inc chat for a consent banner and to start PostHog only after acceptance, and describe PostHog in your privacy policy.
PostHog questions
- Is PostHog overkill for a brochure site?
- Often, yes. If you only need visitor counts, top pages and referrers, the We.Inc Analytics panel covers that without a tag. PostHog earns its place on web apps where you track sign-ups, feature use and returning users.
- Can I use feature flags in code We.Inc generated?
- Yes. With the snippet installed, ask the chat to wrap a new section or feature in a PostHog flag check by name. Create the flag in PostHog first, then publish and test with the flag on and off.
- Which api_host should I use?
- Use the host for the cloud region your PostHog project lives in. The docs example uses the US host; if your project is in another region, copy the snippet from inside your own project so the host matches.
- What happens if I go over the free tier?
- If you have not added billing, PostHog drops extra events and flags return a quota-limited response. With billing set up you pay per unit above the allowance, up to any limit you set.
Sources
Checked October 17, 2026.
- PostHog docs: JavaScript web library (2026-10-17)
- PostHog pricing page (2026-10-17)
- PostHog docs: Billing limits and alerts (2026-10-17)
Related
More Analytics & Tracking integrations.
Ready to integrate PostHog?
Start building your website with We.Inc and connect PostHog in minutes.
More in Integrations
- How to Connect Spring (Teespring) to Your We.Inc Website
- How to Connect Cloudflare Turnstile to Your We.Inc Website
- Vagaro Website Builder: Add Vagaro Booking to Your Site
- Deploy a We.Inc site to your own Vercel account
- AdRoll Integration: Add AdRoll to Your Site
- Ahrefs Integration: Add Ahrefs to Your Site
- Appointlet Integrations: Add Booking to Your Site
- Turn website form entries into Asana tasks
Product
Who It's For
- For Agencies
- For Freelancers
- For Hosting Providers
- For SaaS Platforms
- For Startups
- For Financial Services
- For Healthcare
Features
Resources
- Blog
- Help Center
- Free Business Tools
- Free UI Components
- Website Templates
- Template Collections
- Website Examples
- Guides
- Comparisons
- Alternatives
- Best Lists
- Reviews
- Pricing Guides
- Use Cases
- Glossary & Guides
- Integrations
- Developers
- Benchmark
- Windows App
