미디어위키에서 구글 애널릭틱스 연동하기
GameDic
다운로드
아래 사이트를 통해서 압축되어있는 파일을 받습니다.
설치
설치 파일을 mediawiki의 extensions 폴더에 복사합니다. 다음 코드를 LocalSettings.php에 추가합니다.
require_once "$IP/extensions/googleAnalytics/googleAnalytics.php"; // Replace xxxxxxx-x with YOUR GoogleAnalytics UA number $wgGoogleAnalyticsAccount = 'UA-xxxxxxx-x'; // Add HTML code for any additional web analytics (can be used alone or with $wgGoogleAnalyticsAccount) $wgGoogleAnalyticsOtherCode = '<script type="text/javascript" src="https://analytics.example.com/tracking.js"></script>'; // Optional configuration (for defaults see googleAnalytics.php) // Store full IP address in Google Universal Analytics (see https://support.google.com/analytics/answer/2763052?hl=en for details) $wgGoogleAnalyticsAnonymizeIP = false; // Array with NUMERIC namespace IDs where web analytics code should NOT be included. $wgGoogleAnalyticsIgnoreNsIDs = array(500); // Array with page names (see magic word Extension:Google Analytics Integration) where web analytics code should NOT be included. $wgGoogleAnalyticsIgnorePages = array('ArticleX', 'Foo:Bar'); // Array with special pages where web analytics code should NOT be included. $wgGoogleAnalyticsIgnoreSpecials = array( 'Userlogin', 'Userlogout', 'Preferences', 'ChangePassword', 'OATH'); // Use 'noanalytics' permission to exclude specific user groups from web analytics, e.g. $wgGroupPermissions['sysop']['noanalytics'] = true; $wgGroupPermissions['bot']['noanalytics'] = true; // To exclude all logged in users give 'noanalytics' permission to 'user' group, i.e. $wgGroupPermissions['user']['noanalytics'] = true;
참고
https://www.mediawiki.org/wiki/Extension:Google_Analytics_Integration