From 883b0d031374e95346c48ada3792664e8a4ee283 Mon Sep 17 00:00:00 2001 From: Grace Guo Date: Tue, 25 Feb 2020 21:18:36 -0800 Subject: [PATCH] [dashboard perf logging] add dashboard url anchor component id (#9202) --- superset-frontend/src/dashboard/components/Dashboard.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/superset-frontend/src/dashboard/components/Dashboard.jsx b/superset-frontend/src/dashboard/components/Dashboard.jsx index 669c5ce87..18c2450d0 100644 --- a/superset-frontend/src/dashboard/components/Dashboard.jsx +++ b/superset-frontend/src/dashboard/components/Dashboard.jsx @@ -34,6 +34,7 @@ import OmniContainer from '../../components/OmniContainer'; import { areObjectsEqual } from '../../reduxUtils'; import '../stylesheets/index.less'; +import getLocationHash from '../util/getLocationHash'; const propTypes = { actions: PropTypes.shape({ @@ -83,7 +84,12 @@ class Dashboard extends React.PureComponent { } componentDidMount() { - this.props.actions.logEvent(LOG_ACTIONS_MOUNT_DASHBOARD); + const eventData = {}; + const directLinkComponentId = getLocationHash(); + if (directLinkComponentId) { + eventData.target_id = directLinkComponentId; + } + this.props.actions.logEvent(LOG_ACTIONS_MOUNT_DASHBOARD, eventData); } UNSAFE_componentWillReceiveProps(nextProps) {