0
私は、VB.NETとMVC5を使って構築したテストサイトにGoogle Analyticsを適用する方法を研究しています。 Asyncメソッドを使用しているのは、Google Developersサイトが推薦しているようだからです。私_Layout.vbhtml(自動的に私のために生成されたVisual Studioの)でGoogleアナリティクスでカスタム変数を使用して非同期メソッドを使用するにはどうすればよいですか?
私は<head>
と</head>
タグの間に次のコードを持っている:
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
<script>
window.ga = window.ga || function() { (ga.q = ga.q || []).push(arguments) }; ga.l = +new Date;
ga('create', 'UA-75489237-2', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
<script>
_gaq.push(['_setCustomVar',
5, // This custom var is set to slot #5. Required parameter.
'CusVarTest', // The top-level name for your online content categories. Required parameter.
'Successful', // Sets the value of "Section" to "Life & Style" for this particular aricle. Required parameter.
3 // Sets the scope to page-level. Optional parameter.
]);
</script>
</head>
、理論的には、これが動作しなければならないが、私は行くときGoogleアナリティクスのサイトに移動して、[レポート - >オーディエンス - >カスタム - >カスタム変数]に移動します。
どのような考えですか?
4.カスタム変数(旧式)とカスタムディメンションの両方をページビューより前に設定するか、少なくともインタラクションヒット前に設定する必要があります。カスタムディメンションはGAには送信されません。カスタムディメンションはカスタムバーはクライアントサイドのコードではアクセスできないためですが、このユースケースでは違いはありません)。 –