-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Install PostHog and implement data capture on various buttons #1437
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Compliance Checks
Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.
Watched Files
This pull request modifies specific files that require careful review by the maintainers.
Files Matched
- npm-shrinkwrap.json
- package.json
src/index.jsx
Outdated
@@ -24,6 +25,8 @@ function Index() { | |||
const [isAdmin, setIsAdmin] = useState(null); | |||
|
|||
useEffect(() => { | |||
posthog.init('phc_QFGGi71ugzUOXTLUTwMHVTlaHhDBolEC3XNVHNFHKmz', { api_host: 'https://app.posthog.com' }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might need to put this into ENV var POSTHOG_ID
For #1430 a very small wrapper could be useful, currently, we init PostHog in Other than that and extracting the environment variable to |
That's a good idea, making the wrapper function. I'll go work on that now. So the reason why I added both the issues to this PR was because the implement Posthog PR also required implementing data capture on the login button so I figured since I was adding it there, I might as well just add it to the onboarding buttons here rather than make a whole other PR. Figured referencing both issues and also having separate commits would give enough context. |
I suggested splitting so the wrapper doesn't make the implementation go out of scope, if you want to work on it in this PR that's fine with me, minimal wrapper that logs in, captures event and potential errors; and moving the credentials to the env file should be enough to close both tickets! π π |
Nah, I understand, makes sense. Just feels like this makes the most sense to me honestly. Wanted to ask a quick question. How does the project work with .envs? I don't see an example of using an env variable outside of some stuff in Vite and I didn't want to go Googling stuff in case there was a particular set up that was there. |
Sorry for the late answer, https://vitejs.dev/guide/env-and-mode.html should cover everything on the documentation side. To give specifics, we are using a "dev" local configuration for beta branches and making the Making the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I would love to also capture this in hot.opensauced |
## [0.50.0](v0.49.0...v0.50.0) (2022-05-11) ### π Features * Install PostHog and implement data capture on various buttons ([#1437](#1437)) ([9a78906](9a78906))
π This PR is included in version 0.50.0 π The release is available on: Your semantic-release bot π¦π |
What type of PR is this? (check all applicable)
Description
This PR [adds] the [feature] posthog logging.
Related Tickets & Documents
Resolves #1430 and resolves #1434
Mobile & Desktop Screenshots/Recordings
Added tests?
Added to documentation?
[optional] Are there any post-deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?