Shoora
10/3/2018 - 3:10 PM

ga.js

ga.js

function pageTracking() {
    var url = $_data.URL;
	
    if (!url.startsWith("/")) {
        url = "/" + url;
	}
	
    //console.log(url);
	
    if (isGaLoaded()) {
		
        var ga_url = url;
        //console.log(ga_url);
		
        //Old tracking
        if ('object' === typeof _gaq) {
            _gaq.push(['_trackPageview', ga_url]);
            console.log("Old tracking");
		}
		
        //New tracking
        if ('function' === typeof ga) {
            ga('send', 'pageview', ga_url);
            console.log("New tracking");
		}
	}
}