track ship in ga

This commit is contained in:
willyb321
2018-06-14 06:43:54 +10:00
parent d51009c823
commit e2444a2e4e

View File

@@ -258,6 +258,13 @@ Route.prototype.match = function(path, params) {
* @param {string} path Path to track
*/
function gaTrack(path) {
const match = path.match(/\/outfit\/(.*)(\?code=.*)/);
if (match[1]) {
ReactGA.ga('set', 'contentGroup1', match[1]);
}
if (match[2]) {
ReactGA.ga('set', 'contentGroup2', match[2]);
}
ReactGA.pageview(path);
}