add tracking for code generators
Summary: Tracks a Google Analytics event once the code generator is opened. Reviewed By: emilsjolander Differential Revision: D7097182 fbshipit-source-id: 637a96db981f5e90c9f7ce155ba8669b8dac98fa
This commit is contained in:
committed by
Facebook Github Bot
parent
419e29c5a6
commit
d0bee487e0
@@ -66,7 +66,19 @@ export default class CodeGenerators extends Component<Props, State> {
|
||||
copied: false,
|
||||
};
|
||||
|
||||
onClick = ({key}: {key: string}) => this.setState({showModal: key});
|
||||
_ref: ?HTMLTextAreaElement;
|
||||
|
||||
onClick = ({key}: {key: string}) => {
|
||||
this.setState({showModal: key});
|
||||
if (window.ga) {
|
||||
window.ga('send', {
|
||||
hitType: 'event',
|
||||
eventCategory: 'CodeGenerators',
|
||||
eventAction: 'show',
|
||||
eventLabel: key,
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
onCopy = () => {
|
||||
if (this._ref) {
|
||||
|
Reference in New Issue
Block a user