Commit 0f9eb532 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige carga de Analytics y evento de página

parent 8b0ea931
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -105,10 +105,10 @@ define([
			var script = document.createElement('script'),
				gtagId = redmicConfig.googleAnalyticsId;

			script.async = false;
			script.async = true;
			script.src = 'https://www.googletagmanager.com/gtag/js?id=' + gtagId;

			script.onload = function() {
			document.head.appendChild(script);

			window.dataLayer = [];

@@ -119,9 +119,6 @@ define([

			gtag('js', new Date());
			gtag('config', gtagId);
			};

			document.head.appendChild(script);
		}
	});
});
+3 −1
Original line number Diff line number Diff line
@@ -206,7 +206,9 @@ define([
			//		pj. page, title, version...

			if (this._gtagIsAvailable()) {
				gtag('event', 'page_view', pageInfo);
				gtag('event', 'page_view', {
					page_path: '/' + pageInfo
				});
			}
		},