Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add posthog #718

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

feat: add posthog #718

wants to merge 9 commits into from

Conversation

zlwaterfield
Copy link
Contributor

@zlwaterfield zlwaterfield commented Mar 30, 2024

Adding Posthog.

This first PR is adding page views and autocapture and identify. In subsequent PRs we will add tracking for custom events.

Note: this is not using a proxy right now. We will need to add that.

related to https://github.com/dubinc/dub.co/pull/30

@zlwaterfield zlwaterfield self-assigned this Mar 30, 2024
Copy link

vercel bot commented Mar 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
dub ❌ Failed (Inspect) Mar 30, 2024 3:05pm


if (typeof window !== 'undefined') {
posthog.init(process.env.NEXT_PUBLIC_POSTHOG_KEY as string, {
// api_host: process.env.NEXT_PUBLIC_POSTHOG_HOST as string,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm finding Next.js proxies to be flakey when using rewrites, and I can't seem to get the middleware to hit. Since we don't have the domain in Cloudflare, we can't use a CF worker proxy. @steven-tey maybe you can help me get the middleware to hit and we can follow these https://posthog.com/docs/advanced/proxy/nextjs-middleware

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant