-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: segment events refactoring
- Loading branch information
1 parent
c659cbf
commit 04d0233
Showing
11 changed files
with
129 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/** | ||
* Event Tracking Segments and Naming Pattern | ||
* | ||
* This file contains functions for tracking events using a standardized naming pattern | ||
* within the Open edX Paragon documentation. Events are uniquely identified by the | ||
* following structured convention: openedx.paragon.event_environment.event_name.event_action. | ||
* For instance, 'openedx.paragon.docs.leave_feedback.clicked' represents the specific | ||
* event of clicking the 'Leave Feedback' option. | ||
* | ||
* @module EventTracking | ||
*/ | ||
|
||
export const trackSelectedIconCopy = (context) => { | ||
console.log('trackSelectedIconCopy', context); | ||
global.analytics.track('openedx.paragon.docs.icons-table.selected-icon.copied', context); | ||
}; | ||
|
||
export const trackLeaveFeedbackClick = () => { | ||
console.log('trackLeaveFeedbackClick'); | ||
global.analytics.track('openedx.paragon.docs.leave_feedback.clicked'); | ||
}; | ||
|
||
export const trackPlaygroundClick = () => { | ||
console.log('trackPlaygroundClick'); | ||
global.analytics.track('openedx.paragon.docs.menu.playground.visit_playground.clicked'); | ||
}; | ||
|
||
export const trackContrastCheckerClick = () => { | ||
console.log('trackContrastCheckerClick'); | ||
global.analytics.track('openedx.paragon.docs.menu.tools.visit_contrast_checker.clicked'); | ||
}; | ||
|
||
export const trackPlaygroundUrlCopy = () => { | ||
console.log('trackPlaygroundUrlCopy'); | ||
global.analytics.track('openedx.paragon.docs.playground.copy-url.copied'); | ||
}; | ||
|
||
export const trackPageEditBtnClick = () => { | ||
console.log('trackPageEditBtnClick'); | ||
global.analytics.track('openedx.paragon.docs.page_edit.clicked'); | ||
}; | ||
|
||
export const trackShadowGeneratorLayerEnabled = () => { | ||
console.log('trackShadowGeneratorLayerEnabled'); | ||
global.analytics.track('openedx.paragon.docs.elevation.shadow-generator.layer.enabled'); | ||
}; | ||
|
||
export const trackShadowGeneratorLayerDisabled = () => { | ||
console.log('trackShadowGeneratorLayerDisabled'); | ||
global.analytics.track('openedx.paragon.docs.elevation.shadow-generator.layer.disabled'); | ||
}; | ||
|
||
export const trackShadowGeneratorLayerRemoved = () => { | ||
console.log('trackShadowGeneratorLayerRemoved'); | ||
global.analytics.track('openedx.paragon.docs.elevation.shadow-generator.layer.removed'); | ||
}; | ||
|
||
export const trackShadowGeneratorLayerAdded = () => { | ||
console.log('trackShadowGeneratorLayerAdded'); | ||
global.analytics.track('openedx.paragon.docs.elevation.shadow-generator.layer.added'); | ||
}; | ||
|
||
export const trackShadowGeneratorUpdated = (context) => { | ||
console.log('trackShadowGeneratorUpdated'); | ||
global.analytics.track('openedx.paragon.docs.elevation.shadow-generator.updated', context); | ||
}; | ||
|
||
export const trackTabClick = (tabTitle) => { | ||
console.log('trackTabClick'); | ||
global.analytics.track(`openedx.paragon.docs.insights.tabs.${tabTitle.toLowerCase().trim()}.clicked`); | ||
}; | ||
|
||
export const trackComponentUsageLinkClick = (context) => { | ||
console.log('trackComponentUsageLinkClick', context); | ||
global.analytics.track('openedx.paragon.docs.usage-insights.component-usage-link.clicked', context); | ||
}; | ||
|
||
export const trackSettingsVisibility = (value) => { | ||
console.log('trackSettingsVisibility'); | ||
global.analytics.track(`openedx.paragon.docs.settings.${value ? 'opened' : 'closed'}`); | ||
}; | ||
|
||
export const trackSettingsChange = (settingName, context) => { | ||
console.log('trackSettingsChange'); | ||
global.analytics.track(`openedx.paragon.docs.settings.${settingName}.changed`, context); | ||
}; | ||
|
||
export const trackExampleWithHeading = (collapseIsOpen, context) => { | ||
console.log('trackExampleWithHeading', context); | ||
global.analytics.track(`openedx.paragon.docs.ui.example-code-block.${collapseIsOpen ? 'closed' : 'opened'}`, context); | ||
}; | ||
|
||
export const trackExampleWithoutHeading = (collapseIsOpen, context) => { | ||
console.log('trackExampleWithoutHeading', context); | ||
global.analytics.track(`openedx.paragon.docs.ui.example-code-block.${collapseIsOpen ? 'closed' : 'opened'}`, context); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters