Loading public/javascript/app/components/CookieLoader.js +19 −15 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ define([ this._onCookiesAcceptedHandler && this._onCookiesAcceptedHandler.remove(); this._cookiesNotificationHandler && this._cookiesNotificationHandler.dismiss(); if (window.location.hostname.indexOf("redmic.es") > -1) { if (window.location.hostname.indexOf('redmic.es') !== -1) { this._googleAnalytics(); } }, Loading @@ -102,22 +102,26 @@ define([ // tags: // private (function(i,s,o,g,r,a,m) { i.GoogleAnalyticsObject = r; var script = document.createElement('script'), gtagId = redmicConfig.googleAnalyticsId; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments); script.async = false; script.src = 'https://www.googletagmanager.com/gtag/js?id=' + gtagId; script.onload = function() { window.dataLayer = []; window.gtag = function() { dataLayer.push(arguments); }; i[r].l = 1 * new Date(); a = s.createElement(o); m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a,m); })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', redmicConfig.googleAnalyticsId, 'auto'); ga('send', 'pageview'); gtag('js', new Date()); gtag('config', gtagId); }; document.head.appendChild(script); } }); }); public/javascript/app/redmicConfig.js +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ define([], function() { 'oauthClientId': 'app', 'siteKeyReCaptcha': '6LfA6_0SAAAAACT3i8poH1NqztZCtIW1OahT0cXs', 'siteKeyForDebugReCaptcha': '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', 'googleAnalyticsId': 'UA-58848624-1' 'googleAnalyticsId': 'G-J753HC86F0' }; retObj.viewPaths = { Loading public/javascript/redmic/modules/base/Analytics.js +16 −8 Original line number Diff line number Diff line Loading @@ -191,6 +191,11 @@ define([ this._publish(channel); }, _gtagIsAvailable: function() { return typeof gtag !== 'undefined'; }, _trackPageView: function(/*Object*/ pageInfo) { // summary: // Permite trakear una página vista en google analytics Loading @@ -200,8 +205,8 @@ define([ // Puede ser un string con la url de la página o un objeto con más información // pj. page, title, version... if (typeof ga != "undefined") { ga('send', 'pageview', pageInfo); if (this._gtagIsAvailable()) { gtag('event', 'page_view', pageInfo); } }, Loading @@ -220,9 +225,12 @@ define([ // Valor del evento // ** label y value son opcionales if (typeof ga != "undefined") { ga('send', 'event', eventInfo.category, eventInfo.action, eventInfo.label, eventInfo.value); if (this._gtagIsAvailable()) { gtag('event', eventInfo.action, { event_category: eventInfo.category, event_label: eventInfo.label, value: eventInfo.value }); } }, Loading @@ -234,8 +242,8 @@ define([ // exceptionInfo // Objecto con información de la excepción. ej: exDescription, exFatal(boolen)... if (typeof ga != "undefined") { ga('send', 'exception', exceptionInfo); if (this._gtagIsAvailable()) { gtag('event', 'exception', exceptionInfo); } } }); Loading Loading
public/javascript/app/components/CookieLoader.js +19 −15 Original line number Diff line number Diff line Loading @@ -91,7 +91,7 @@ define([ this._onCookiesAcceptedHandler && this._onCookiesAcceptedHandler.remove(); this._cookiesNotificationHandler && this._cookiesNotificationHandler.dismiss(); if (window.location.hostname.indexOf("redmic.es") > -1) { if (window.location.hostname.indexOf('redmic.es') !== -1) { this._googleAnalytics(); } }, Loading @@ -102,22 +102,26 @@ define([ // tags: // private (function(i,s,o,g,r,a,m) { i.GoogleAnalyticsObject = r; var script = document.createElement('script'), gtagId = redmicConfig.googleAnalyticsId; i[r] = i[r] || function() { (i[r].q = i[r].q || []).push(arguments); script.async = false; script.src = 'https://www.googletagmanager.com/gtag/js?id=' + gtagId; script.onload = function() { window.dataLayer = []; window.gtag = function() { dataLayer.push(arguments); }; i[r].l = 1 * new Date(); a = s.createElement(o); m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a,m); })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', redmicConfig.googleAnalyticsId, 'auto'); ga('send', 'pageview'); gtag('js', new Date()); gtag('config', gtagId); }; document.head.appendChild(script); } }); });
public/javascript/app/redmicConfig.js +1 −1 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ define([], function() { 'oauthClientId': 'app', 'siteKeyReCaptcha': '6LfA6_0SAAAAACT3i8poH1NqztZCtIW1OahT0cXs', 'siteKeyForDebugReCaptcha': '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI', 'googleAnalyticsId': 'UA-58848624-1' 'googleAnalyticsId': 'G-J753HC86F0' }; retObj.viewPaths = { Loading
public/javascript/redmic/modules/base/Analytics.js +16 −8 Original line number Diff line number Diff line Loading @@ -191,6 +191,11 @@ define([ this._publish(channel); }, _gtagIsAvailable: function() { return typeof gtag !== 'undefined'; }, _trackPageView: function(/*Object*/ pageInfo) { // summary: // Permite trakear una página vista en google analytics Loading @@ -200,8 +205,8 @@ define([ // Puede ser un string con la url de la página o un objeto con más información // pj. page, title, version... if (typeof ga != "undefined") { ga('send', 'pageview', pageInfo); if (this._gtagIsAvailable()) { gtag('event', 'page_view', pageInfo); } }, Loading @@ -220,9 +225,12 @@ define([ // Valor del evento // ** label y value son opcionales if (typeof ga != "undefined") { ga('send', 'event', eventInfo.category, eventInfo.action, eventInfo.label, eventInfo.value); if (this._gtagIsAvailable()) { gtag('event', eventInfo.action, { event_category: eventInfo.category, event_label: eventInfo.label, value: eventInfo.value }); } }, Loading @@ -234,8 +242,8 @@ define([ // exceptionInfo // Objecto con información de la excepción. ej: exDescription, exFatal(boolen)... if (typeof ga != "undefined") { ga('send', 'exception', exceptionInfo); if (this._gtagIsAvailable()) { gtag('event', 'exception', exceptionInfo); } } }); Loading