SchweppesAle Posted November 3, 2009 Share Posted November 3, 2009 Hate to stir up this old debate (log vs page tagging analytics). I've been told that Google Analytics will only track page views incorrectly if it's been set up wrong, despite the following article -> http://www.seomoz.org/blog/how-reliable-is-google-analytics In order to further test our numbers, I set up an AJAX script to test our numbers and they are in fact matching up with Google Analytics;which is waaaay lower than AWSTATs is reporting. I'm starting to think that some javascript on the page is potentially slowing down the execution of these two scripts. Is it possible the following code is causing the issue? I'm not really a javascript guru and it's something I threw together a while back in order to resize images: function checkImageSize() { if (document.getElementById('Latest2') != null) { resize_FrontAuthor(); } if (document.getElementById('Latest') != null) { resize_ListAuthors(); } resize_images(); } function resize_images() { var myDiv = document.getElementById('center'); var myImages = myDiv.getElementsByTagName("img");/* var myImages = myDiv.images;*/ for (i = 0; i < myImages.length; i++) { myImages[i].style.display = "inline"; if ( myImages[i].width > 450 && (myImages[i].className != 'noresize')) { var tempHeight = myImages[i].height; var tempWidth = myImages[i].width; myImages[i].onclick=function() { var picture = window.open(this.src, 'popupwindow' , 'width ='+tempWidth+', height = '+tempHeight+', scrollbars = no, resizable'); picture.focus(); return false; }; myImages[i].style.border = '2px solid #ffffff'; myImages[i].style.padding = '2px'; myImages[i].onmouseover = function(){ this.style.border = '2px solid red'; return false; }; myImages[i].onmouseout = function(){ this.style.border = '2px solid #ffffff'; return false; }; var scaleheight = 450/(myImages[i].width) *(myImages[i].height); myImages[i].width = 450; myImages[i].height = scaleheight; myImages[i].style.cursor='pointer'; } myImages[i].style.visibility = "visible"; } } function resize_ListAuthors() { var myDiv = document.getElementById('Latest'); var myImages = myDiv.getElementsByTagName("img"); for (i = 0; i < myImages.length; i++) {/* while ( !myImages[i].complete ) { }*/ myImages[i].style.display = "inline"; var tempHeight = myImages[i].height; var tempWidth = myImages[i].width; if ( myImages[i].width > 100 && (myImages[i].className != 'noresize')) { var scaleheight = 100/(myImages[i].width) *(myImages[i].height); myImages[i].width = 100; myImages[i].height = scaleheight; myImages[i].style.cursor='pointer'; } myImages[i].style.visibility = "visible"; } } function resize_FrontAuthor() { var myDiv = document.getElementById('Latest2'); var myImages = myDiv.getElementsByTagName("img"); for (i = 0; i < myImages.length; i++) {/* while ( !myImages[i].complete ) { }*/ myImages[i].style.display = "inline"; var tempHeight = myImages[i].height; var tempWidth = myImages[i].width; if ( myImages[i].width > 75 && (myImages[i].className != 'noresize')) { var scaleheight = 75/(myImages[i].width) *(myImages[i].height); myImages[i].width = 75; myImages[i].height = scaleheight; myImages[i].style.cursor='pointer'; } myImages[i].style.visibility = "visible"; } } probably not the cleanest code. If this where configured to run onload within the body, could it potentially prevent any other scripts from executing though? The page itself is reporting no errors within IE. Is it really possible that Awstats numbers are so completely skewed? Quote Link to comment https://forums.phpfreaks.com/topic/180135-google-analytics/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.