MediaWiki:Mobile.js: Difference between revisions
Jump to navigation
Jump to search
(Google Analytics 4) |
(No difference)
|
Revision as of 09:52, 7 November 2023
/* All JavaScript here will be loaded for users of the mobile site */ /* Google Analytics 4 */ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} if ( // Not tracked: admin/bot users, anyone on login/logout pages. !(',' + mw.config.get('wgUserGroups').join(',') + ',').match(/,(sysop|bureaucrat|bot),/) && ['Userlogin', 'Userlogout', 'Preferences', 'Resetpass'].indexOf(mw.config.get('wgCanonicalSpecialPageName')) === -1 ) { gtag('js', new Date()); gtag('config', 'G-27TV985M4'); $('head').append($('<script/>').attr('async', 1).attr('src', 'https://www.googletagmanager.com/gtag/js?id=G-27TV985M4')); } /* /Google Analytics 4 */