MCPcopy Index your code
hub / github.com/github/docs / trackEvent

Function trackEvent

components/page-footer/Survey.tsx:206–216  ·  view source on GitHub ↗
(formData?: FormData)

Source from the content-addressed store, hash-verified

204}
205
206function trackEvent(formData?: FormData) {
207 if (!formData) return
208 // Nota bene: convert empty strings to undefined
209 return sendEvent({
210 type: EventType.survey,
211 survey_token: (formData.get('survey-token') as string) || undefined, // Honeypot
212 survey_vote: formData.get('survey-vote') === 'Y',
213 survey_comment: (formData.get('survey-comment') as string) || undefined,
214 survey_email: (formData.get('survey-email') as string) || undefined,
215 })
216}

Callers 2

voteFunction · 0.85
submitFunction · 0.85

Calls 1

sendEventFunction · 0.90

Tested by

no test coverage detected