Skip to content

Commit 04e66bb

Browse files
committed
improve rss analytics code
1 parent f9c153d commit 04e66bb

1 file changed

Lines changed: 9 additions & 20 deletions

File tree

src/lib/analytics.ts

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ enum Objects {
1919
CHANGE_LOG = 'Change Log',
2020
MARKETING_CAMPAIGN = 'Marketing Campaign',
2121
ONBOARDING = 'Onboarding',
22-
CUSTOM_SOURCE = 'Custom Source',
22+
RSS = 'Rss',
2323
}
2424

2525
enum Verbs {
@@ -275,6 +275,14 @@ export const trackOnboardingFinish = () => {
275275
})
276276
}
277277

278+
export const trackRssSourceAdd = (source: string) => {
279+
trackEvent({
280+
object: Objects.RSS,
281+
verb: Verbs.ADD,
282+
attributes: { [Attributes.SOURCE]: source },
283+
})
284+
}
285+
278286
// Identification
279287

280288
export const identifyUserLanguages = (languages: string[]) => {
@@ -302,25 +310,6 @@ export const identifyUserOccupation = (occupation: string) => {
302310
identifyUserProperty(Attributes.OCCUPATION, occupation)
303311
}
304312

305-
// Custom RSS Sources
306-
307-
export const trackRssSourceRemove = (source: string) => {
308-
trackEvent({
309-
object: Objects.CUSTOM_SOURCE,
310-
verb: Verbs.REMOVE,
311-
attributes: { [Attributes.SOURCE]: source },
312-
})
313-
}
314-
315-
export const trackRssSourceAdd = (source: string) => {
316-
trackEvent({
317-
object: Objects.CUSTOM_SOURCE,
318-
verb: Verbs.ADD,
319-
attributes: { [Attributes.SOURCE]: source },
320-
})
321-
}
322-
323-
324313

325314
// Private functions
326315
type trackEventProps = {

0 commit comments

Comments
 (0)