如何在Dashboard上查看Google Analytics维度变量 [英] How to see Google Analytics dimension variables on Dashboard

查看:127
本文介绍了如何在Dashboard上查看Google Analytics维度变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在经历一个奇怪的问题;可能是我做错了什么。



我需要查看在我的网站上登录的所有用户名(及其分析)的列表。我创建了一个dimension1变量,并在Google Analytics上以Session类型列出了User Name。



以下是我在代码中所做的:



PS 这段代码在 analyticstracking.php 中,位于页面末尾(之后body标签)

  var user =<?php echo $ _SESSION ['username'];?> ; 

if(user){
// alert(user);
(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-1','thesite.com');

var dimensionValue = user;

// ga('set','dimension1',dimensionValue);
ga('set',{
'dimension1':dimensionValue,
'metric1':1
});

ga('send','pageview');
}



这就是我在Google Analytics中所做的:





<现在我希望在做完所有这些之后,我会看到所有记录的用户名列表,当我点击它们时,它会向我显示所有相关的分析。



但没有任何事情发生。

任何想法如果我做错了什么?



谢谢

解决方案

是的,要创建一个自定义报表:


  1. 登录GA并转到顶部的< Customization ,然后点击 +新建自定义报告

  2. 选择您想要查看自定义报告的指标,例如会话,浏览量等。

  3. 选择您想要查看的维度。在您的情况下,这将是用户名

  4. 点击保存。

您现在应该可以看到您的数据。



我再次强烈建议您使用User Id而不是User Name。 p>


I am going through a strange problem; may be I am doing something wrong.

I need to see list of all Usernames (and their analytics) which logged in on my site. I created a dimension1 variable and listed as "User Name" with a "Session" type on Google Analytics.

Here is what I did in my code:-

P.S. This code is in analyticstracking.php which is at the end of the page (after the "body" tag)

var user = "<?php echo $_SESSION['username']; ?>";

  if (user) {
    //alert(user);
    (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-1', 'thesite.com');

    var dimensionValue = user;

    //ga('set', 'dimension1', dimensionValue); 
    ga('set', {
      'dimension1': dimensionValue,
      'metric1': 1
    }); 

    ga('send', 'pageview');
}

This is what I did in Google Analytics:-

Now I am hoping that after doing all this, I'd see the list of all recorded Usernames and when I click on them, It'd show me all the respective analytics.

But nothing is happening.

Any idea if I am doing something wrong?

Thanks

解决方案

Yep, to create a custom report:

  1. log into GA and go to "Customization" at the top, and then click "+ New Custom Report".
  2. Select the metrics you want to see for the custom report e.g. sessions, pageviews, etc.
  3. Select the dimension you want to see. In your case, that will be User Name.
  4. Click save.

You should now see your data.

Again, I would strongly urge you to use User Id rather than User Name.

这篇关于如何在Dashboard上查看Google Analytics维度变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆