Guest User

Untitled

a guest
May 23rd, 2018
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import React from 'react';
  2. import ReactGA from 'react-ga';
  3.  
  4. export default class SomeComponent extends React.Component {
  5.  
  6. handleClick() {
  7. ReactGA.event({
  8. category: 'Navigation',
  9. action: 'Clicked Link',
  10. });
  11. }
  12.  
  13. render() {
  14.  
  15. return (
  16. <div>
  17. <a onClick={()=>{this.handleClick()}}>Link</a>
  18. </div>
  19. );
  20. }
  21. }
Add Comment
Please, Sign In to add comment