views:

691

answers:

5

Google Analytics confuses me.

I have always had a feeling that the Google Analytics visitor count for my eCommerce website was too low. Today I took a closer look.

Last weekend there were about 8 orders (by different customers) on the website on Saturday and 9 on Sunday. Google Analytics however shows only 3 visitors on both Saturday and Sunday.

The following familiar code snippet is in the main template of the site, which is called on every click.

<script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
    try {
     var pageTracker = _gat._getTracker("UA-xxxxxxx-1");
     pageTracker._trackPageview();
    } catch(err) {}
</script>

Yes, I am filtering (excluding) some fixed IP addresses from being counted, but only of my own sites.

I know that visitors that have Javascript disabled cannot be counted, but I do not believe this explains it.

What is going on, is this normal? Does anyone know why more than half of the visitors are not counted?

A: 

I am using Google Analytics for many of my sites and so far have not faced this issue.You can check with the google support page here. Also have you checked whether your site is configured to use the correct Time Zone?

Shoban
A: 

I know that visitors that have Javascript disabled cannot be counted, but I do not believe this explains it.

Have you looked at your server's access logs? Marry them up with Google Analytics, see which visitors weren't being counted?

Paul D. Waite
+1  A: 

While reading this StackOverflow quesion I noticed that I had changed the script block:

<script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
        try {
                var pageTracker = _gat._getTracker("UA-xxxxxxx-1");
                pageTracker._trackPageview();
        } catch(err) {}
</script>

Which should be split into two parts, according to Google:

<script type="text/javascript">
        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
        try {
                var pageTracker = _gat._getTracker("UA-xxxxxxx-1");
                pageTracker._trackPageview();
        } catch(err) {}
</script>

I have changed it to the recommended format and am awaiting what happens in the next few days.

Wil
+1  A: 

This should be on the top of your content.

<script type="text/javascript">
    var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
    document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>

This should on the bottom of your content:

<script type="text/javascript">
    try {
            var pageTracker = _gat._getTracker("UA-xxxxxxx-1");
            pageTracker._trackPageview();
    } catch(err) {}
</script>

If you have done this, it should work correctly.

Polichism
Thanks, but why top and bottom of the content? GA only says "Copy the following code block into every webpage you want to track immediately before the </body> tag."
Wil
I tought it was something about the page isn't ready yet when the script wants to run.
Polichism
A: 

You can set up another profile to gather unfiltered data and compare the reports to the filtered profile.

Liam