Skip to content

Commit 5e340cb

Browse files
committed
add matomo tracking for panel toggling
1 parent 5ab890d commit 5e340cb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libs/remix-api/src/lib/plugins/matomo/events/ui-events.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ export interface TopbarEvent extends MatomoEventBase {
2727
category: 'topbar';
2828
action:
2929
| 'GIT'
30+
| 'panelShown'
31+
| 'panelHidden'
3032
| 'header';
3133
}
3234

libs/remix-ui/top-bar/src/lib/remix-ui-topbar.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,25 +107,31 @@ export function RemixUiTopbar() {
107107
// Listen to left side panel events
108108
plugin.on('sidePanel', 'leftSidePanelHidden', () => {
109109
setLeftPanelHidden(true)
110+
trackMatomoEvent({ category: 'topbar', action: 'panelHidden', name: 'leftSidePanel', isClick: true })
110111
})
111112
plugin.on('sidePanel', 'leftSidePanelShown', () => {
112113
setLeftPanelHidden(false)
114+
trackMatomoEvent({ category: 'topbar', action: 'panelShown', name: 'leftSidePanel', isClick: true })
113115
})
114116

115117
// Listen to terminal panel events
116118
plugin.on('terminal', 'terminalPanelHidden', () => {
117119
setBottomPanelHidden(true)
120+
trackMatomoEvent({ category: 'topbar', action: 'panelHidden', name: 'terminalPanel', isClick: true })
118121
})
119122
plugin.on('terminal', 'terminalPanelShown', () => {
120123
setBottomPanelHidden(false)
124+
trackMatomoEvent({ category: 'topbar', action: 'panelShown', name: 'terminalPanel', isClick: true })
121125
})
122126

123127
// Listen to right side panel events
124128
plugin.on('rightSidePanel', 'rightSidePanelHidden', () => {
125129
setRightPanelHidden(true)
130+
trackMatomoEvent({ category: 'topbar', action: 'panelHidden', name: 'rightSidePanel', isClick: true })
126131
})
127132
plugin.on('rightSidePanel', 'rightSidePanelShown', () => {
128133
setRightPanelHidden(false)
134+
trackMatomoEvent({ category: 'topbar', action: 'panelShown', name: 'rightSidePanel', isClick: true })
129135
})
130136

131137
// Initialize panel states from localStorage

0 commit comments

Comments
 (0)