LoginSignup
1
2

More than 5 years have passed since last update.

AdventCalendar2018 9 WordPress でつくるブログメディアの企画で、GoogleAnalytics の設定

Posted at
  • マーケティング
    • 9日目
      • GoogleAnalytics
      • GoogleTagManager
      • GoogleSearchConsole

GoogleAnalytics

https://analytics.google.com を導入します。

スクリーンショット 2018-12-24 12.23.23.png

スクリーンショット 2018-12-24 12.24.22.png

スクリーンショット 2018-12-24 12.24.34.png

スクリーンショット 2018-12-24 12.25.00.png

スクリーンショット 2018-12-24 12.25.08.png

トラッキング ID
UA-131342XXX-1 というのが見えたら完了です。

GoogleTagManager

Google Tag Manager
https://tagmanager.google.com/

からアクセスします。

コンテナを作成

スクリーンショット 2018-12-24 14.07.51.png

スクリーンショット 2018-12-24 14.08.10.png

コンテナが作成されます。

WordPress テーマの header.php にタグを追加

略
<?php wp_head(); ?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
<!-- End Google Tag Manager -->
</head>
<body <?php body_class(); ?>>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

タグを追加しました。

TagManager の画面からタグを作成します。

タグ > 新規
スクリーンショット 2018-12-24 18.29.34.png

スクリーンショット 2018-12-24 18.30.02.png

スクリーンショット 2018-12-24 18.30.21.png

スクリーンショット 2018-12-24 18.52.10.png

スクリーンショット 2018-12-24 18.30.41.png

All Pages を選択肢ます。

これで公開します。

スクリーンショット 2018-12-24 19.11.01.png

Analytics のリアルタイム画面でアクセスが取れていれば成功です。

GoogleSearchConsole

SearchConsole にアクセスします。
https://search.google.com

スクリーンショット 2018-12-24 19.40.29.png
スクリーンショット 2018-12-24 19.40.52.png
スクリーンショット 2018-12-24 19.48.53.png

TagManager が入っていると自動で認識されます。

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2