Commit 983cd722 authored by Andrew Hrdy's avatar Andrew Hrdy

Fixed matomo, fully removed GA

parent b53bfa9b
Pipeline #2787 passed with stage
in 1 minute and 50 seconds
# Changelog
## [2.1.4] - 2018-08-28
### Added
- Basic matomo analytics for tracking page views
### Removed
- Google analytics
## [2.1.3] - 2018-05-24
### Fixed
......@@ -57,4 +67,5 @@
[2.1.0]: https://git.gmu.edu/srct/whats-open-web/compare/v2.0.1...v2.1-Midnight-Cherry
[2.1.1]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1-Midnight-Cherry...v2.1.1
[2.1.2]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1.1...v2.1.2
[2.1.3]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1.2...v2.1.3
\ No newline at end of file
[2.1.3]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1.2...v2.1.3
[2.1.4]: https://git.gmu.edu/srct/whats-open-web/compare/v2.1.3...v2.1.4
\ No newline at end of file
......@@ -32,13 +32,28 @@
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.png">
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v0.40.1/mapbox-gl.css' rel='stylesheet' />
</head>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-112607180-1"></script>
<body>
<script type="text/javascript">
/*
The following code is generated by matomo to use for analytics.
*/
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "//matomo.srct.gmu.edu/";
_paq.push(['setTrackerUrl', u + 'piwik.php']);
_paq.push(['setSiteId', '2']);
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>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
</body>
......
export const initMatomo = () => {
const _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
const u = '//matomo.srct.gmu.edu/';
_paq.push(['setTrackerUrl', `${u}piwik.php`]);
_paq.push(['setSiteId', '2']);
const newScriptTag = document.createElement('script');
const firstScriptTag = document.getElementsByTagName('script')[0];
newScriptTag.type = 'text/javascript';
newScriptTag.async = true;
newScriptTag.defer = true;
newScriptTag.src = `${u}piwik.js`;
firstScriptTag.parentNode.insertBefore(newScriptTag, firstScriptTag);
};
\ No newline at end of file
......@@ -2,7 +2,6 @@ import React from 'react';
import ReactDOM from 'react-dom';
import {applyMiddleware, compose, createStore} from 'redux';
import './index.css';
import {initMatomo} from './analytics/matomo';
import Layout from './containers/Layout';
import registerServiceWorker from './registerServiceWorker';
import createHistory from 'history/createBrowserHistory';
......@@ -27,10 +26,6 @@ if (isProduction || !extension) {
enhance = compose(applyMiddleware(ReduxThunk, routerMiddleware(history)), extension);
}
if (isProduction) {
initMatomo();
}
const store = createStore(reducers, enhance);
ReactDOM.render(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment