Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
history.listen(location => {
ReactGA.set({ page: location.hash })
ReactGA.pageview(location.hash)
// console.log(location.pathname, location.hash)
})
import store, { history } from './store';
import { GA_ID } from './config';
import {
setUser,
loginSetUserLocalStorageAndCookie
} from './user/actions/doUser';
import { GlobalStateProvider } from './state';
import 'bootstrap/dist/css/bootstrap.css';
import './App.css';
if (GA_ID && GA_ID !== '') {
ReactGA.initialize(GA_ID, {
debug: process.env.NODE_ENV === 'development'
});
ReactGA.pageview(window.location.pathname + window.location.search);
}
// Language
store.dispatch(doChangeLanguage(getDefaultLanguage()));
// User Authentication
const token = window.localStorage.getItem('token');
if (token && token !== 'undefined' && token !== '') {
const user = JSON.parse(window.localStorage.getItem('user'));
if (user) {
// Dispatch action
store.dispatch(setUser(token, user));
loginSetUserLocalStorageAndCookie(token, user);
}
}
componentDidMount() {
if ('gaid' in this.props.options) {
ReactGA.initialize(this.props.options.gaid);
ReactGA.pageview(window.location.pathname + window.location.search);
}
}
pageview: (page) => {
GoogleAnalytics.pageview(page);
},
modalview: (modalName) => {
const pageView = () => ReactGA.pageview(document.location.pathname);
const trackPage = page => {
if (process.env.NODE_ENV !== 'production') {
return;
}
ReactGA.set({
page,
...options,
});
ReactGA.pageview(page);
ABA.pageview(page);
};
export const logPageView = () => {
ReactGA.set({
page: window.location.pathname,
});
ReactGA.pageview(window.location.pathname);
};
function trackPage(page) {
ReactGA.set({ page });
ReactGA.pageview(page);
}
onClick={() => ReactGA.pageview('/download')}
href="https://kap-updates.now.sh/download"