GeneralMagicio / pairwise-RPGF4

Pairwise for Optimism RetroPGF4
https://app.pairwise.vote
15 stars 1 forks source link

Set up PostHog for MVP #46

Closed MoeNick closed 3 months ago

MoeNick commented 4 months ago

@mosaeedi created the account.

https://posthog.com/docs/libraries/js

Funnel rough:

mosaeedi commented 4 months ago

I'll update this issue by Tuesday this week!

mosaeedi commented 4 months ago

1.Installing PostHog

You can find the guides to install PostHog on the project here -> Link to PostHog Doc

NOTE: You will need an API key, I'm not sure if I can just paste it here, whoever wants to install it can reach out to me for the API Key!

2.Setup Auto capture

We need to set up the PostHog Auto capture feature to ensure the session recording is working. Find the Docs here -> Link to PostHog doc

3.Send custom events

We have to send some custom events to set up more precise Funnels! For sending custom events -> Link to PostHog Doc

For each of these steps, we need to send a custom event.

1. Landing page

Event name: Just landed

2. Login page

Event name: Opened Login Page

3. Logged in

Event name: User Logged In Custom properties: Login by: Login Method

4. Landed in the categories page

Event name: User goes to the Categories page Custom properties: Category: Name of the category they have selected

5. connect from the landing page.

!!!

6. Filtered

Event name: Filtered Custom properties: categories: List of the categories they've Filtered Attempts: ex: First time

7. Ranked

Event name: Ranked categories: List of the categories they've Ranked

8. Attested

Event name: Attested Custom properties: categories: List of the categories they've Attested

9. Category comparison

Event name: Comparing categories Custom properties: categories: Categories they are comparing

10. Attest between categories.

Event name: Attested between categories Custom properties: categories: Categories they are attesting to

ahmadabugosh commented 3 months ago

hey @jainkrati @mmahdigh @mosaeedi, Can we start with steps 1 and 2? Those are just a few lines of code and shouldn't require much work for us to at least get basic analytics (if we need step 3 later on we can worry about it later).

MoeNick commented 3 months ago

Spending an hour on this for thses 2 first issues.

ahmadabugosh commented 3 months ago

@MoeNick Are there any blockers on this?

mosaeedi commented 3 months ago

For Pairwise, we are using the EU servers from PostHog, So to be able to connect to the PostHog account we need to use ...eu.i.posthog... domain, Right now, Pairwise is trying to connect to ...us.i.posthog... and return an error.

Screenshot 2024-06-23 at 2 19 13 PM
MoeNick commented 3 months ago

Tagging @mmahdigh @lovelgeorge99 to fix

lovelgeorge99 commented 3 months ago

@mmahdigh you just need to change the environment variable for POST_HOG_HOST to https://eu.i.posthog.com

mmahdigh commented 3 months ago

Done. Ready for retesting. @mosaeedi @MoeNick

mosaeedi commented 3 months ago

It's working! You can close this issue if you need.