How to use the react-ga.outboundLink function in react-ga

To help you get started, we’ve selected a few react-ga examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wellcometrust / wellcomecollection.org / common / views / components / OutboundLinkTracker / OutboundLinkTracker.js View on Github external
function handleClick(event: { target: any }) {
    const url = event.target.href;

    // We check for the type here as SVGs have a href type of `SVGAnimatedString`
    if (typeof url === 'string' && isExternal(url)) {
      ReactGA.outboundLink(
        {
          category: 'outbound',
          action: 'click',
          label: url,
        },
        () => {} // ReactGA requires the hitCallback arg
      );
    }
  }
github cncjs / cncjs / src / app / lib / analytics.js View on Github external
outboundLink: (args, hitCallback) => {
        const { label } = { ...args };
        GoogleAnalytics.outboundLink({ label }, hitCallback);
    },
    exception: (args) => {
github kids-first / kf-portal-ui / src / services / analyticsTracking / googleAnalytics.js View on Github external
export const trackExternalLink = url => {
  if (url) ReactGA.outboundLink({ label: url }, () => {});
};
github elamperti / OpenWebScrobbler / src / store / actions / userActions.js View on Github external
return () => {
    ReactGA.outboundLink({
      label: 'Login intent',
      to: lastfmAuthURL
    }, () => {
      window.location = lastfmAuthURL;
    });
  };
}
github kennethlumalicay / betterweb / src / js / config / google-analytics.js View on Github external
export const logOutboundLink = (label) => {
  ga.outboundLink({
    label: label,
  }, () => {});
};
github pluto-net / scinapse-web-client / app / helpers / handleGA.ts View on Github external
export function trackAndOpenLink(from: string) {
  if (EnvChecker.isProdBrowser()) {
    ReactGA.outboundLink(
      {
        label: from,
      },
      () => {}
    );
  }
}