added migrations for instant delivery
This commit is contained in:
31
node_modules/ga-react-router/src/ga.js
generated
vendored
Normal file
31
node_modules/ga-react-router/src/ga.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
if(typeof window !== 'undefined' && typeof GA_TRACKING_CODE !== 'undefined') {
|
||||
(function(window, document, script, url, r, tag, firstScriptTag) {
|
||||
window['GoogleAnalyticsObject']=r;
|
||||
window[r] = window[r] || function() {
|
||||
(window[r].q = window[r].q || []).push(arguments)
|
||||
};
|
||||
window[r].l = 1*new Date();
|
||||
tag = document.createElement(script),
|
||||
firstScriptTag = document.getElementsByTagName(script)[0];
|
||||
tag.async = 1;
|
||||
tag.src = url;
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
})(
|
||||
window,
|
||||
document,
|
||||
'script',
|
||||
'//www.google-analytics.com/analytics.js',
|
||||
'ga'
|
||||
);
|
||||
|
||||
var ga = window.ga;
|
||||
|
||||
ga('create', GA_TRACKING_CODE, 'auto');
|
||||
|
||||
module.exports = function() {
|
||||
return window.ga.apply(window.ga, arguments);
|
||||
};
|
||||
} else {
|
||||
module.exports = function() {console.log(arguments)};
|
||||
}
|
||||
12
node_modules/ga-react-router/src/index.js
generated
vendored
Normal file
12
node_modules/ga-react-router/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
var ga = require('./ga');
|
||||
|
||||
|
||||
function analytics(state) {
|
||||
ga('send', 'pageview', {
|
||||
'page': state.path
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
module.exports = analytics;
|
||||
Reference in New Issue
Block a user