Difference between revisions of "MediaWiki:Common.js"
From SmartWiki
| (2 intermediate revisions by one other user not shown) | |||
| Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | var gaScript = document.createElement('script'); | |
| − | + | gaScript.setAttribute('async', ''); | |
| − | + | gaScript.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=G-NLH5JWWVN7'); | |
| − | + | document.head.appendChild(gaScript); | |
| − | |||
| − | + | window.dataLayer = window.dataLayer || []; | |
| + | function gtag(){dataLayer.push(arguments);} | ||
| + | gtag('js', new Date()); | ||
| + | gtag('config', 'G-NLH5JWWVN7'); | ||
Latest revision as of 09:04, 29 July 2025
/* Any JavaScript here will be loaded for all users on every page load. */
var gaScript = document.createElement('script');
gaScript.setAttribute('async', '');
gaScript.setAttribute('src', 'https://www.googletagmanager.com/gtag/js?id=G-NLH5JWWVN7');
document.head.appendChild(gaScript);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-NLH5JWWVN7');