1window.dataLayer = window.dataLayer || []; 2function gtag() { 3 dataLayer.push(arguments); 4} 5gtag('js', new Date()); 6// Drupal's global gtag ID. For more info: https://developers.google.com/tag-platform/devguides/gtag-integration 7gtag('set', 'developer_id.dMDhkMT', true); 8 9(function (drupalSettings) { 10 if (!drupalSettings.gtag) {return;} 11 function init() { 12 const config = drupalSettings.gtag; 13 const url = new URL(window.location.href); 14 if (url.searchParams.has('ref')) { 15 gtag('set', 'page_referrer', url.searchParams.get('ref')); 16 url.searchParams.delete('ref'); 17 window.history.pushState({}, '', url); 18 } 19 20 if (config.consentMode === true) { 21 gtag('consent', 'default', { 22 ad_storage: 'denied', 23 analytics_storage: 'denied', 24 ad_user_data: 'denied', 25 ad_personalization: 'denied', 26 wait_for_update: 500, 27 }); 28 } 29 30 if (config.tagId.length !== 0) { 31 const script = document.createElement('script'); 32 script.async = true; 33 script.src = `https://www.googletagmanager.com/gtag/js?id=${config.tagId}`; 34 script.type = 'text/javascript'; 35 document.getElementsByTagName('head')[0].appendChild(script); 36 } 37 38 const additionalConfigInfo = config.additionalConfigInfo || []; 39 if (additionalConfigInfo.length === 0) { 40 gtag('config', config.tagId); 41 } else { 42 gtag('config', config.tagId, additionalConfigInfo); 43 } 44 45 const otherIds = config.otherIds || []; 46 otherIds.forEach((id) => gtag('config', id)); 47 48 const events = config.events || []; 49 events.forEach((event) => gtag('event', event.name, event.data)); 50 } 51 52 if (window.waitRedirection) { 53 document.body.addEventListener('redirected', () => { 54 init(); 55 }); 56 } else { 57 init(); 58 } 59 60})(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.