I'm facing issues with enabling Google analytics on my app. Need help
I've created a .js file with the following code:
var _gaq = _gaq || [];
//Note: you should replace this value with your personal site data.
gaq.push(['setAccount', 'UA-62826163-1']);
gaq.push(['trackPageview']);
//Add event handler on page show.
var onPageShow = function(){
//Track page into GA when it has been shown
gaq.push(['trackPageview', window.location.href]);
};
jQuery(document).bind("pageshow", onPageShow);
(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);
})();
Do I need to add any event on pages after this?