deltahacks / landing-11

1 stars 1 forks source link

feat: add posthog analytics #12

Closed Krish120003 closed 2 months ago

Krish120003 commented 2 months ago

Adds PostHog to the landing page. This uses a next.js rewrite to proxy the requests through and prevent blocking

netlify[bot] commented 2 months ago

Deploy Preview for deltahacks11 ready!

Name Link
Latest commit 3eac50016076128b9c4144ac42b210a5e62c086f
Latest deploy log https://app.netlify.com/sites/deltahacks11/deploys/66f35b4c5cdca0000838e49e
Deploy Preview https://deploy-preview-12--deltahacks11.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

err53 commented 2 months ago

Ok, and that requires the env variable being set to our own URL. Gotcha

Jason Huang e: @.*** m: (647) 631-6610

On Tue, Sep 24, 2024 at 22:06 Krish @.***> wrote:

@.**** commented on this pull request.

In src/env.js https://github.com/deltahacks/landing-11/pull/12#discussion_r1774305195:

@@ -26,6 +28,8 @@ export const env = createEnv({ runtimeEnv: { NODE_ENV: process.env.NODE_ENV, // NEXT_PUBLIC_CLIENTVAR: process.env.NEXT_PUBLIC_CLIENTVAR,

  • NEXT_PUBLIC_POSTHOG_KEY: process.env.NEXT_PUBLIC_POSTHOG_KEY,
  • NEXT_PUBLIC_POSTHOG_HOST: process.env.NEXT_PUBLIC_POSTHOG_HOST,

Oh this is to prevent adblockers from the analytics ingest. This actually is a proxy, and the rewrites route requests from Next to Posthog. The request flow is like so:

Posthog Client -> Netlify (at HOST/ingest endpoint etc) -> Posthog API

— Reply to this email directly, view it on GitHub https://github.com/deltahacks/landing-11/pull/12#discussion_r1774305195, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACZ37XRCVV5KS3JTZAWFKL3ZYILDJAVCNFSM6AAAAABOQOJDAGVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDGMRWHAYTQNBZHE . You are receiving this because your review was requested.Message ID: @.***>