Reputation: 13537
I've added the website tracking code just above of my site:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXX-1']);
_gaq.push(['_trackPageview']);
_gaq.push(['_setDomainName', 'none']);
(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>
Notice that I set the domain name to "none" so that it will work on localhost. I then added a an event trigger:
jQuery( ".selectButton" ).click(function() {
_gaq.push(["_trackEvent", "Experiment 1", "Clicked", "Fund X Clicked"]);
});
When I trigger this, I can see in my "networking" console of my browser:
http://www.google-analytics.com/__utm.gif?utmwv=5.6.0&utms=2&utmn=XXXX&utmhn=localhost&utmt=event&utme=5(Experiment%201*Clicked*Select%20Fund%20with%20ID%20-%201)&utmcs=UTF-8&utmsr=1600x900&utmvp=1584x534&utmsc=24-bit&utmul=en-us&utmje=1&utmfl=15.0%20r0&utmdt=Experiment%201%20%7C%20XXXXX&utmhid=79XXXXXX&utmr=0&utmp=%2Fag%2Fwww%2Fexperiment-1&utmht=1413XXXXXXX&utmac=UA-XXXXXX-1&utmcc=__utma%3D111872281.1692363809.1413440349.1413440349.1413440349.1%3B%2B__utmz%3D111872281.1413440349.1.1.utmcsr%3D(direct)%7Cutmccn%3D(direct)%7Cutmcmd%3D(none)%3B&utmjid=&utmu=6BAAAAAAAAAAAAAAAAAAAAAE~
In other words, it is talking to Google. But I can't see any results in Google Analytics. Any idea as to why? What am I doing wrong? Or am I supposed to wait 24 hour before results will appear?
Upvotes: 0
Views: 38
Reputation: 8907
The network response looks good - I can see the utme parameters (utme=5(Experiment%201*Clicked*Select%20Fund%20with%20ID%20-%201), different than what you have in your code above, but probably for anonymity reasons). Normally you would need to wait at least 24 hours before the data is reported in your standard reports. In the meantime, you can check if you can see the event in your Real-Time reports (do this within 30 minutes of sending in the event).
Upvotes: 1