Skip to content

Commit

Permalink
Add google event logs into new features pop ups.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentao-Kuang committed Oct 24, 2024
1 parent 4a684f2 commit decca16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/landing/src/components/feature.updates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { clsx } from 'clsx';
import { Component, ReactNode } from 'react';
import ReactModal from 'react-modal';

import { Config } from '../config.js';
import { Config, GaEvent, gaEvent } from '../config.js';

type FeatureUpdatesProps = {
header: string;
Expand Down Expand Up @@ -37,6 +37,7 @@ export class FeatureUpdates extends Component<FeatureUpdatesProps, FeatureUpdate
handleClose = (): void => {
this.setState({ showModal: false });
window.localStorage.setItem(this.props.id, this.props.dismissedKey);
gaEvent(GaEvent.Ui, `news:${this.props.id.toLowerCase()}:close`);
};

override render(): ReactNode {
Expand All @@ -46,6 +47,7 @@ export class FeatureUpdates extends Component<FeatureUpdatesProps, FeatureUpdate
if (!showModal) return null;
if (Config.map.isDebug) return;

gaEvent(GaEvent.Ui, `news:${this.props.id.toLowerCase()}:open`);
return (
<ReactModal
isOpen={showModal}
Expand Down

0 comments on commit decca16

Please sign in to comment.