1const dl = drupalSettings.gtm.settings.data_layer || 'dataLayer'; 2window[dl] = window[dl] || []; 3 4(function (drupalSettings) { 5 const config = drupalSettings.gtm; 6 7 window[dl].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' }); 8 const gtmSettings = config.settings; 9 if (gtmSettings.include_classes === true) { 10 window[dl].push({ 11 'gtm.allowlist': gtmSettings.allowlist_classes ?? [], 12 'gtm.blocklist': gtmSettings.blocklist_classes ?? [], 13 }); 14 } 15 16 let gtm_environment = ''; 17 if (gtmSettings.include_environment === true) { 18 const gtm_auth = gtmSettings.environment_token ?? ''; 19 const gtm_preview = gtmSettings.environment_id ?? ''; 20 gtm_environment = `>m_auth=${gtm_auth}>m_preview=${gtm_preview}>m_cookies_win=x`; 21 } 22 if (Array.isArray(config.tagIds)) { 23 config.tagIds.forEach(function (tagId) { 24 const script = document.createElement('script'); 25 script.async = true; 26 const dLink = dl != 'dataLayer' ? `&l=${dl}` : ''; 27 script.src = `https://www.googletagmanager.com/gtm.js?id=${tagId}${gtm_environment}${dLink}`; 28 script.type = 'text/javascript'; 29 document.getElementsByTagName('head')[0].appendChild(script); 30 }); 31} 32})(drupalSettings);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.