Commit a680cf92 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Habilita entorno de desarrollo para GTM

parent 5e169c7a
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5,7 +5,8 @@ define([], function() {
	var retObj = {
		'siteKeyReCaptcha': '6LfA6_0SAAAAACT3i8poH1NqztZCtIW1OahT0cXs',
		'siteKeyForDebugReCaptcha': '6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI',
		'googleTagManagerId': 'GTM-PK5MH63C'
		'googleTagManagerId': 'GTM-PK5MH63C',
		'googleTagManagerDevParams': '&gtm_auth=cSgmYdWWNLp8VkfFPXeSYg&gtm_preview=env-5&gtm_cookies_win=x'
	};

	retObj.viewPaths = {
+5 −5
Original line number Diff line number Diff line
@@ -95,19 +95,19 @@ define([
			this._cookiesNotificationHandler && this._cookiesNotificationHandler.dismiss();

			var isProduction = (/true/i).test(redmicConfig.getEnvVariableValue('envProduction'));
			if (isProduction) {
				this._loadGoogleTagManager();
			}

			this._loadGoogleTagManager(isProduction);
		},

		_loadGoogleTagManager: function() {
		_loadGoogleTagManager: function(isProduction) {

			var gtmId = redmicConfig.googleTagManagerId,
				gtmDevParams = isProduction ? '' : redmicConfig.googleTagManagerDevParams,
				headScript = `
					(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
					new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
					j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
					'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
					'https://www.googletagmanager.com/gtm.js?id='+i+dl+${gtmDevParams};f.parentNode.insertBefore(j,f);
					})(window,document,'script','dataLayer','${gtmId}');
				`,
				headScriptElement = globalThis.document.createElement('script'),