문제

I have setup Google Analytics script in my web site, I am using Analytics.js

<script type='text/javascript'>

  (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', 'wfihotspotnet.in');
  ga('send', 'pageview');


  var dimensionValue1="21";
  ga('set', 'dimension1', dimensionValue1);
  var dimensionValue2="male";
  ga('set', 'dimension2', dimensionValue2);
  var dimensionValue3="India";
ga('set', 'dimension3', dimensionValue3);


</script>

In My Custom Reports Dashboard I have created Three reports with,

Custom Dimension Age and Metrics Pageview

Similarly for Gender vs PageView and Location vs Pageview

I have more than 400 Pageviews but In custom Dimension No data is displayed

I used Chrome GA.debug Extension and it is displaying that data is processed

what silly Mistake I have done ?

도움이 되었습니까?

해결책

You have sent your pageview before you've set the dimensions. Custom dimensions need an interaction call to be sent to the server so in your example they are not event sent. Move the "set" calls between the lines that create the tracker and the pageview call and you should be fine.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top