[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

View File

@@ -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) {