Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render: function () {
const path = this.getPath().slice(1);
// logs the full path, including the hash, to google analytics (if analytics is enabled)
if (window.config.analytics) {
const fullHref = window.location.href;
const origin = window.location.origin;
const fullPathWithHash = fullHref.startsWith(origin) ? fullHref.slice(origin.length) : fullHref;
ReactGA.ga('send', 'pageview', fullPathWithHash);
}
return (
<div>
<footer>
</footer></div>
);
}
});
trackRouteUpdate(props) {
if (__SERVER__) return;
if (!this.state.initialized) return;
ReactGA.ga("send", "pageview", props.location.pathname);
// this.logTrack(props);
}
handleLottery( type ) {
const { quota } = this.state;
const bang = this.getLotteryList( type );
if( type === 0 ) {
FB.AppEvents.logEvent("handleLottery", quota, {CONTENT_TYPE: 'reactions'});
ReactGA.ga('send', 'handleLottery', 'reactions');
}
else if ( type === 1 ){
FB.AppEvents.logEvent("handleLottery", quota, {CONTENT_TYPE: 'comments'});
ReactGA.ga('send', 'handleLottery', 'comments');
}
else if ( type === 2 ){
FB.AppEvents.logEvent("handleLottery", quota, {CONTENT_TYPE: 'shareds'});
ReactGA.ga('send', 'handleLottery', 'shareds');
}
this.setState({
bang,
loading: true
});
setTimeout(()=>{
componentWillMount() {
this.loadPage(this.props);
ReactGA.ga('send', 'pageview', `${this.props.location && this.props.location.pathname}`);
}
import MainView from "./views/MainView";
import configureStore from "./store/configureStore";
import * as serviceWorker from "./serviceWorker";
import "./styles/normalize.css";
import "./styles/base.css";
if (process.env.NODE_ENV === "production" && process.env.REACT_APP_RAVEN_PUBLIC_DSN) {
Raven.config(process.env.REACT_APP_RAVEN_PUBLIC_DSN, {
release: process.env.REACT_APP_VERSION,
}).install();
}
if (process.env.NODE_ENV === "production" && process.env.REACT_APP_GA_TRACKING_ID) {
ReactGA.initialize(process.env.REACT_APP_GA_TRACKING_ID);
ReactGA.ga("set", "anonymizeIp", true);
ReactGA.pageview(window.location.pathname + window.location.search);
}
ReactDOM.render(
,
document.getElementById("root"),
);
serviceWorker.register();
import React from 'react';
import FullStory, { FullStoryAPI } from 'react-fullstory';
import GA from 'react-ga';
const env = process.env.NODE_ENV;
const isProduction = env === 'production';
if (isProduction) {
GA.initialize('UA-137049621-1');
GA.ga((tracker) => {
const trackerClientId = tracker.get('clientId');
const fullstoryInitted = setInterval(() => {
if (window._fs_namespace) {
FullStoryAPI('identify', trackerClientId);
clearInterval(fullstoryInitted);
}
}, 500);
});
}
function Analytics() {
return (
{ isProduction
&&
componentWillMount() {
this.fetchPage(this.props);
ReactGA.ga('send', 'pageview', `${this.props.location && this.props.location.pathname}`);
}
componentWillMount() {
this.loadPage(this.props);
ReactGA.ga('send', 'pageview', `${this.props.location && this.props.location.pathname}`);
}
componentWillMount() {
this.fetchPage(this.props);
ReactGA.ga(
'send',
'pageview',
`${this.props.location && this.props.location.pathname}`
);
}
donateClick(amount: number) {
const ga = ReactGA.ga();
ga('send', 'event', 'donate', amount, amount);
window.open(Constants.DONATE_URL + '?amount=' + amount, '_blank');
}