0
votes

I've implemented Google Universal Analytics a few weeks ago (with user tracking and dimensions) and suddenly the number of tracked unique visitors dropped from 3,000 a day to a handful a day. I can't figure out why GA doesn't track all visits any longer.

Below you see how I track the UserID and how I set dimension1. Values for dimension1 are 'Visitor', 'Admin', 'Customer' and 'Member'.

<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-123456-1','auto');
  ga('send','UA-123456-1');
  ga('set','&uid',777);
  ga('set','dimension1','Visitor');
</script>
1

1 Answers

3
votes

If that is your exact code (minus the UA ID, of course), then you're not sending any pageviews. You should have

ga('send', 'pageview');

but instead you have

ga('send', 'UA-123456-1');

This would also explain why your dimension1 isn't being set.