switch to google analytics from piwik

This commit is contained in:
willyb321
2018-06-12 07:56:01 +10:00
parent 3d5a9ef220
commit 27ce82de3b
4 changed files with 15 additions and 6 deletions

9
package-lock.json generated
View File

@@ -10760,6 +10760,15 @@
"prop-types": "^15.5.10"
}
},
"react-ga": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/react-ga/-/react-ga-2.5.3.tgz",
"integrity": "sha512-25wvPv1PVLDLhw1gEYP33h0V2sJHahKMfUCAxhq8JPYmNQwx1fcjJAkJk+WmSqGN93lHLhExDkxy3SQizQnx3A==",
"requires": {
"prop-types": "^15.6.0",
"react": "^15.6.2 || ^16.0"
}
},
"react-measure": {
"version": "1.4.7",
"resolved": "https://registry.npmjs.org/react-measure/-/react-measure-1.4.7.tgz",

View File

@@ -109,6 +109,7 @@
"prop-types": "^15.5.8",
"react": "^15.5.4",
"react-dom": "^15.5.4",
"react-ga": "^2.5.3",
"react-number-editor": "Athanasius/react-number-editor.git#miggy",
"recharts": "^0.22.3",
"superagent": "^3.5.2"

View File

@@ -1,5 +1,6 @@
import Persist from './stores/Persist';
import ReactGA from 'react-ga';
ReactGA.initialize('UA-55840909-18');
let standalone = undefined;
/**
@@ -257,9 +258,7 @@ Route.prototype.match = function(path, params) {
* @param {string} path Path to track
*/
function gaTrack(path) {
if (window.ga) {
window.ga('send', 'pageview', path);
}
ReactGA.pageview(path);
}
/**

View File

@@ -38,7 +38,7 @@
<% } %>
<!-- Piwik -->
<script type="text/javascript">
<!-- <script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setCookieDomain", "*.coriolis.edcd.io"]);
@@ -51,7 +51,7 @@
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
</script>-->
<!-- End Piwik Code -->
<!-- Bugsnag -->