どこどこJPとGoogleアナリティクスの連携
どこどこJPとGoogleアナリティクスの連携での最後のステップとなりました。トラッキングコートをHTMLへ設置します。ここではHTMLファイルに直接設置する方法をご説明します。
以下のサンプルを参考に、2箇所を書き換えてください。
<!--docodocojp--> <script type="text/javascript" src="//api.docodoco.jp/v5/docodoco?key=どこどこJPのAPIキー1" charset="utf-8"></script> <script type="text/javascript" src="//api.docodoco.jp/docodoco_ua_plugin_2.js" charset="utf-8"></script> <!--Google Analytics--> <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-お客様固有のGoogleアナリティクスプロパティID', 'auto'); ga('set', 'dimension1' , SURFPOINT.getOrgName()); //組織名 ga('set', 'dimension2' , SURFPOINT.getOrgUrl()); //組織URL ga('set', 'dimension3' , getIndL(SURFPOINT.getOrgIndustrialCategoryL())); //業種大分類 ga('set', 'dimension4' , getEmp(SURFPOINT.getOrgEmployeesCode())); //従業員数 ga('set', 'dimension5' , getTime()); //アクセス時刻 ga('set', 'dimension6' , getIpo(SURFPOINT.getOrgIpoType())); //上場区分 ga('set', 'dimension7' , getCap(SURFPOINT.getOrgCapitalCode())); //資本金 ga('set', 'dimension8' , getGross(SURFPOINT.getOrgGrossCode())); //売上高 ga('set', 'dimension9' , SURFPOINT.getCountryJName()); //国名 ga('set', 'dimension10' , SURFPOINT.getPrefJName()); //都道府県名 ga('set', 'dimension11' , SURFPOINT.getLineJName()); //回線名 ga('send', 'pageview'); </script>
- 1.「どこどこJPの APIキー1」をお客様固有のAPIキーに置き換えます。
- 2.「UA-お客様固有のGoogleアナリティクスプロパティID」を置き換えます。
そしてカスタマイズしたトラッキングコードを、計測の対象とするWebサイトの全てのページHTML中の</head>タグ直前に設置しましょう。
連携設定はこれで完了です。Googleアナリティクスに解析結果が反映されるようになるまで数時間必要です。
一連の流れは、動画でもご紹介しています。ぜひ、ご参考にしてくださいね。
※2017年4月1日付で「サイバーエリアリサーチ株式会社」から「株式会社Geolocation Technology」に社名を変更いたしました。
動画内にて旧社名(サイバーエリアリサーチ株式会社)の表記がございますがご容赦ください。