「MediaWikiへのGoogle Analyticsを設置(1.16.0 Vector)」の版間の差分
提供: Wikiducca
(The Pioneer (ノート) による版 4360 を取り消し) |
|
| (9人の利用者による、間の14版が非表示) | |
(相違点なし)
| |
2019年1月9日 (水) 08:09時点における最新版
skins/Vector.php の
// Output HTML Page
$this->html( 'headelement' );
?>
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<!-- content -->
を
// Output HTML Page
$this->html( 'headelement' );
?>
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- /Google Analytics -->
<div id="mw-page-base" class="noprint"></div>
<div id="mw-head-base" class="noprint"></div>
<!-- content -->
とすればOK。