views:

756

answers:

4

Hi

I'm reworking some site tracking for a site I'm working with. For the tracking we are currently using Google Analytics, which seems to be working fairly well. However, I'm having some troubles resembling the ones in this question, but it's old and no one answered, so I'm bumping a bit here. :)

Basically, I'm tracking two kinds of things. Raw pageviews (entering a page), and events on the page (lightbox opened, something important clicked, etc). I'm using _trackPageview for both kinds of events, because I need to be able to track some lightbox flows in GA's goal funnel tracking, and as I understand it _trackEvent calls can't be tracked in goal funnels.

The problem here is that it seems like the way GA works, it doesn't really post its data instantly (firebug doesn't show any requests happening, at least), but defers it to a page refresh or something like that. I'm not totally sure what happens, but basically I'm getting all events up to the first one leading to a page refresh all shuffled up in the funnel and looking like they all happened as an exit from the event causing the refresh. (Did that make sense? :) Is there any way of forcing GA to "flush" an event when it happens and not defer it? Or am I using things totally wrong?

EDIT: I was a bit blind reading the firebug logs... It does actually do the request to __utm.gif with the correct data. Makes the funnel being weird even more strange though, so the basic question is still valid.

Thanks

A: 

I believe each call to _trackPageview will submit a unique request to Google Analytics (via parameters to the __utm.gif object). Google Analytics is pretty tough to debug since there is such a lag between the time your send your data, until it is actually visible online. Typically, you will have to wait 4+ hours before your data will show up - so maybe you just need to wait to confirm that your code is working.

mckoss
Well, I do have data from a couple of days, so it's not delay that way. It _could_ be that I do multiple tracking points too quick in sequence and that the requests arrive out of sequence, but I don't know. It seems too "deterministic". 99% of all the exits are shown as exits from the trackpoint happening at the next page refresh...
Dentoid
A: 

Hmmm... I really only have experience with the old GA, but it seems to me that your best course of action is decoding the utm.gif request and seeing if it contains incorrect information. Here's a list of debugging tools that Google recommends.

mooreds
+1  A: 

I made a function for this. We wanted to track how many people click on each on of a few links we have so we "track pageviews" for it.

 function trackPV(trackerCode, url)
{
    var tracker = _gat._getTracker(trackerCode);
    if(url)
    { 
     tracker._trackPageview(url);
    }
    else
    {
     tracker._trackPageview();
    }
}

Basically, you pass in your tracker code (UA-XXXXX) and a url if you'd like to, such as "http://www.example.com/link1", by default it just tracks the page you are on.

Hope this helps.

Kaanon
A: 

use "event tracking" . At least check it out in google analytics help.