feat: add posthog analytics support (#52)

* feat: add posthog analytics events

* Update internal/analytics/analytics.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>

---------

Signed-off-by: Sahil Bansal <bansalsahil315@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Sahil Bansal
2025-06-30 09:47:14 +05:30
committed by GitHub
co-authored by Copilot
parent 0a62473e9a
commit 0e17378d3e
12 changed files with 234 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package analytics
const (
eventRun = "pmg_command_run"
eventCommandNpm = "pmg_command_npm"
eventCommandPnpm = "pmg_command_pnpm"
eventCommandPip = "pmg_command_pip"
eventPmgGenerateEnvDocker = "pmg_command_generate_env_docker"
eventPmgGenerateEnvGitHubActions = "pmg_command_generate_env_github_actions"
eventPmgGenerateEnvGitLabCI = "pmg_command_generate_env_gitlab_ci"
)
func TrackCommandRun() {
TrackEvent(eventRun)
}
func TrackCommandNpm() {
TrackEvent(eventCommandNpm)
}
func TrackCommandPnpm() {
TrackEvent(eventCommandPnpm)
}
func TrackCommandPip() {
TrackEvent(eventCommandPip)
}
func TrackCommandGenerateEnvDocker() {
TrackEvent(eventPmgGenerateEnvDocker)
}
func TrackCommandGenerateEnvGitHubActions() {
TrackEvent(eventPmgGenerateEnvGitHubActions)
}
func TrackCommandGenerateEnvGitLabCI() {
TrackEvent(eventPmgGenerateEnvGitLabCI)
}