Skip to content

Commit

Permalink
fixed ga, removed console log
Browse files Browse the repository at this point in the history
  • Loading branch information
fidalgodev committed Apr 8, 2019
1 parent 7cf0b44 commit 0b2f8a4
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 17 deletions.
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Expand Up @@ -15,6 +15,7 @@
"react": "^16.8.4",
"react-burger-menu": "^2.6.5",
"react-dom": "^16.8.4",
"react-ga": "^2.5.7",
"react-helmet": "^6.0.0-beta",
"react-lazyload": "^2.5.0",
"react-modal-video": "^1.2.1",
Expand Down
14 changes: 0 additions & 14 deletions public/index.html
Expand Up @@ -40,20 +40,6 @@
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script
async
src="https://www.googletagmanager.com/gtag/js?id=UA-137885307-1"
></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());

gtag('config', 'UA-137885307-1');
</script>

<!--
This HTML file is a template.
Expand Down
4 changes: 4 additions & 0 deletions src/containers/App.js
Expand Up @@ -4,6 +4,7 @@ import { Router, Switch, Route, Redirect } from 'react-router-dom';
import history from '../history';
import { connect } from 'react-redux';
import { init } from '../actions';
import ReactGA from 'react-ga';

import Sidebar from './Sidebar';
import MenuMobile from './MenuMobile';
Expand Down Expand Up @@ -91,6 +92,9 @@ const SearhBarWrapper = styled.div`
padding: 2rem;
`;

ReactGA.initialize('UA-137885307-1');
ReactGA.pageview(window.location.pathname + window.location.search);

const App = ({ init, isLoading }) => {
useEffect(() => {
init();
Expand Down
2 changes: 0 additions & 2 deletions src/containers/Movie.js
Expand Up @@ -304,8 +304,6 @@ const Movie = ({
history.push(process.env.PUBLIC_URL + '/404');
}

console.log(loaded);

return (
<Wrapper>
<Helmet>
Expand Down
5 changes: 4 additions & 1 deletion src/index.js
Expand Up @@ -19,7 +19,10 @@ ReactDOM.render(
<Fragment>
<Helmet>
<title>Movie Library</title>
<meta name="description" content="A Movie Library where you can check all your favorite movies, as well as the cast of it, and so mucnh more! Made with ❤️ by Fidalgo" />
<meta
name="description"
content="A Movie Library where you can check all your favorite movies, as well as the cast of it, and so mucnh more! Made with ❤️ by Fidalgo"
/>
<link rel="canonical" href="https://movies.fidalgo.dev" />
</Helmet>
<App />
Expand Down

0 comments on commit 0b2f8a4

Please sign in to comment.