php - How to see Google Analytics dimension variables on Dashboard -


i going through strange problem; may doing wrong.

i need see list of usernames (and analytics) logged in on site. created dimension1 variable , listed "user name" "session" type on google analytics.

here did in code:-

p.s. code in analyticstracking.php @ end of page (after "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 did in google analytics:-

ga dimension

now hoping after doing this, i'd see list of recorded usernames , when click on them, it'd show me respective analytics.

but nothing happening.

any idea if doing wrong?

thanks

yep, create custom report:

  1. log ga , go "customization" @ top, , click "+ new custom report".
  2. select metrics want see custom report e.g. sessions, pageviews, etc.
  3. select dimension want see. in case, user name.
  4. click save.

you should see data.

again, urge use user id rather user name.

enter image description here


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -