「MediaWiki/Google Analyticsを導入」の版間の差分

提供: dsk's note
移動: 案内検索
1行目: 1行目:
Google Analyticsを導入した。
+
Google Analyticsを導入した。<br />
当サイトの場合だと、MonoBookをデフォルトのデザインとして設定しているので、skins/MonoBook.phpを以下の箇所を編集した。
+
当サイトの場合だと、MonoBookをデフォルトのデザインとして設定しているので、skins/MonoBook.phpの以下の箇所を編集しました。
本当はHTMLのheder部分を出力しているものが別に存在していると思われるが、とりあえず動けばと暫定的に...
+
本当はHTMLのheder部分を出力しているものが別に存在していると思われ、そこを編集したかったんだが、とりあえず動けばと暫定的に...
 
<pre>
 
<pre>
 
$this->html( 'headelement' );
 
$this->html( 'headelement' );

2014年1月9日 (木) 16:54時点における版

Google Analyticsを導入した。
当サイトの場合だと、MonoBookをデフォルトのデザインとして設定しているので、skins/MonoBook.phpの以下の箇所を編集しました。 本当はHTMLのheder部分を出力しているものが別に存在していると思われ、そこを編集したかったんだが、とりあえず動けばと暫定的に...

		$this->html( 'headelement' );
?><div id="globalWrapper">
		$this->html( 'headelement' );
?>

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXXXXX-X', 'sakura.ne.jp');
  ga('send', 'pageview');

</script>

<div id="globalWrapper">