简体   繁体   中英

Google Analytics Real Time Data not appearing

I am developing a website and to track events I have implemented ga.js. But my Real Time data is not appearing. I have written the code as:

<script>

var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-XXXXXXXX-1']); // COP14
      _gaq.push(['_setDomainName', 'https://www.XXXXX.com']);
      _gaq.push(['_setCustomVar',1,'UserID','20503',2]);
      _gaq.push(['_setCustomVar',2,'UserName','JXXXXX HXXXXX',2]);
      _gaq.push(['_setCustomVar',3,'UserEmail','xxx@xxxxx.com',2]);
      _gaq.push(['_setCustomVar',4,'IP_Address','XXX.XX.XXX.XXX',2]);
      _gaq.push(['_trackPageview']);      

      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
      })(); 

</script>

The error it is showing is this:

    Could not set the throttling cookie: __utmt
ga_debug.js:24 logga_debug.js:23 
Nga_debug.js:62  
Jfga_debug.js:22 
dd.(anonymous function).gbga_debug.js:15 
nga_debug.js:66 G.Jaga_debug.js:15 
a.(anonymous function)ga_debug.js:44
 G.Sga_debug.js:42
 G.pushga_debug.js:15 a.(anonymous function
)ga_debug.js:85 (anonymous function)ga_debug.js:85 
$ega_debug.js:85 aga_debug.js:85 (anonymous function)
ga_debug.js:85 (anonymous function)

Here is the full console output:

_gaq.push processing "_setAccount" for args: "[UA-XXXXXXXX-1]": 
ga_debug.js:24 _gaq.push processing "_setDomainName" for args: "[https://www.XXXXX.com]": 
ga_debug.js:24 _gaq.push processing "_setCustomVar" for args: "[1,UserID,20503,2]": 
ga_debug.js:24 Found UA client id
ga_debug.js:24 _gaq.push processing "_setCustomVar" for args: "[2,UserName,JXXXXX HXXXXX,2]": 
ga_debug.js:24 _gaq.push processing "_setCustomVar" for args: "[3,UserEmail,jXXXh@XXXXXXX.com,2]": 
ga_debug.js:24 _gaq.push processing "_setCustomVar" for args: "[4,IP_Address,XXX.XXX.XXX.XXX]": 
ga_debug.js:24 _gaq.push processing "_trackPageview" for args: "[]": 
ga_debug.js:24 Track Pageview
ga_debug.js:24 Setting throttling cookie: __utmt
ga_debug.js:24 Could not set the throttling cookie: __utmtga_debug.js:24 logga_debug.js:23 Nga_debug.js:62 Jfga_debug.js:22 dd.(anonymous function).gbga_debug.js:15 nga_debug.js:66 G.Jaga_debug.js:15 a.(anonymous function)ga_debug.js:44 G.Sga_debug.js:42 G.pushga_debug.js:15 a.(anonymous function)ga_debug.js:85 (anonymous function)ga_debug.js:85 $ega_debug.js:85 aga_debug.js:85 (anonymous function)ga_debug.js:85 (anonymous function)
ga_debug.js:24 Tracking beacon sent!
utmwv=5.6.1d&utms=1&utmn=1845035680&utmhn=www.eventbuizz.com&utmcs=UTF-8&utmsr=1920x1080&utmvp=1919x593&utmsc=24-bit&…t)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmu=qRAAAAAAAAAAAAAAAAABAAgE~
ga_debug.js:24 Account ID               : UA-XXXXXXXXX-1
Page Title               : DIF Årsmøde 2014
Host Name                : www.XXXXXXXX.com
Page                     : /conference_demo/dif--rsm-de-2014/index.php?mod=home&func=dashboard
Referring URL            : 0
Hit ID                   : 1066628628
Visitor ID               : 1326311187
Session Count            : 1
Session Time - First     : Fri Nov 21 2014 17:56:56 GMT 0500 (PKT)
Session Time - Last      : Fri Nov 21 2014 17:56:56 GMT 0500 (PKT)
Session Time - Current   : Fri Nov 21 2014 17:56:56 GMT 0500 (PKT)
Campaign Time            : Fri Nov 21 2014 17:56:56 GMT 0500 (PKT)
Campaign Session         : 1
Campaign Count           : 1
Campaign Source          : (direct)
Campaign Medium          : (none);
Campaign Name            : (direct)
Language                 : en-us
Encoding                 : UTF-8
Flash Version            : 15.0 r0
Java Enabled             : true
Screen Resolution        : 1920x1080
Browser Size             : 1919x593
Color Depth              : 24-bit
Ga.js Version            : 5.6.1d
Cachebuster              : 1845035680

So, what's wrong with my code?

You can use Google tag manager to implement GA, which will be more efficient and easy. Also you are using classic GA which is outdated. Try using universal analytics and implement using GTM. Very simple and straight forward.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM