[dashboard perf logging] add dashboard url anchor component id (#9202)

This commit is contained in:
Grace Guo 2020-02-25 21:18:36 -08:00 committed by GitHub
parent 57321dc1f6
commit 883b0d0313
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -34,6 +34,7 @@ import OmniContainer from '../../components/OmniContainer';
import { areObjectsEqual } from '../../reduxUtils'; import { areObjectsEqual } from '../../reduxUtils';
import '../stylesheets/index.less'; import '../stylesheets/index.less';
import getLocationHash from '../util/getLocationHash';
const propTypes = { const propTypes = {
actions: PropTypes.shape({ actions: PropTypes.shape({
@ -83,7 +84,12 @@ class Dashboard extends React.PureComponent {
} }
componentDidMount() { 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) { UNSAFE_componentWillReceiveProps(nextProps) {