Skip to content

Commit

Permalink
feat: Add mixpanel event to onboarding container open modal
Browse files Browse the repository at this point in the history
  • Loading branch information
calvin-codecov committed Jan 24, 2025
1 parent b6f0d85 commit b2390e2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/pages/OwnerPage/OnboardingOrg/OnboardingOrg.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from 'react'

import orgListInstallApp from 'assets/onboarding/org_list_install_app.png'
import { eventTracker } from 'services/events/events'
import AppInstallModal from 'shared/AppInstallModal'
import Button from 'ui/Button'

Expand Down Expand Up @@ -46,7 +47,16 @@ function OnboardingOrg() {
<div className="mt-2">
<Button
variant="primary"
onClick={() => setShowModal(true)}
onClick={() => {
setShowModal(true)
eventTracker().track({
type: 'Button Clicked',
properties: {
buttonName: 'Open App Install Modal',
buttonLocation: 'Onboarding Container',
},
})
}}
hook="install-codecov-link"
>
<span>Install Codecov</span>
Expand Down
5 changes: 4 additions & 1 deletion src/services/events/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,8 @@ export abstract class EventTracker {
// Extend as needed.
//

type ButtonName = 'Install GitHub App' | 'Configure Repo'
type ButtonName =
| 'Install GitHub App'
| 'Configure Repo'
| 'Open App Install Modal'
type PageName = 'Owner Page'

0 comments on commit b2390e2

Please sign in to comment.