Skip to content

Commit 097da01

Browse files
committed
add galaxy event for cloud advert
1 parent 860ce0c commit 097da01

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/lib/galaxy/galaxy.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export const galaxyOnPage = (prefix, depsArray = []) => {
8686
galaxyOnFocus(`${prefix}.window.focus`, depsArray);
8787
};
8888

89+
// Pass String with convention 'namespace.component.eventName'
8990
export const galaxyOnClick = (event) => {
9091
return () => {
9192
window.galaxy.track(event, { interaction: "click" });

src/theme/DocItem/TOC/Desktop/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import clsx from "clsx";
66
import IconClose from '@theme/Icon/Close';
77
import styles from './styles.module.scss'
88
import Feedback from '../../../../components/Feedback';
9+
import {galaxyOnClick} from "../../../../lib/galaxy/galaxy";
910

1011
const AD_DATA_ENDPOINT = 'https://cms.clickhouse-dev.com:1337/api/docs-ad'
1112

@@ -96,6 +97,7 @@ export default function DocItemTOCDesktop() {
9697
className={styles.docCloudClose}
9798
onClick={() => {
9899
setClosed(true)
100+
galaxyOnClick('docs.sidebarCloudAdvert.buttonClick')
99101
window.sessionStorage.setItem('doc-cloud-card-banner', 'closed');
100102
}}>
101103
<IconClose color="var(--ifm-color-emphasis-600)" width={10} height={10}/>

0 commit comments

Comments
 (0)