Closed (fixed)
Project:
Google Analytics
Version:
6.x-3.2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Apr 2011 at 06:48 UTC
Updated:
30 Apr 2011 at 08:51 UTC
Hi all,
we are having problems tracking flowplayer video events with google analytics. We achieved it applying a timeout to the js code, but we are unnable without it.
According to this page, we need to put this code:
<script type="text/javascript">
var _tracker = _gat._getTracker("[YOUR TRACKING CODE]");
</script>
Directly after the <script src="http://www.google-analytics.com/ga.js"></script> call.
So, we added var _tracker = _gat._getTracker("[YOUR TRACKING CODE]");, in our analytics conf page, on the after snippet. But firebugging it, the problem with that setup is that without the timeout, the object is undefined, so no event is tracked.
At least it works, but seems a little dirty for me... any idea? Thanks in advance, Simon.
Comments
Comment #1
hass commentedYou need to upgrade to async code version.
Comment #2
SimonVlc commentedThat's the 6.3.3 hass?
Thx!
Comment #3
hass commented3.x is async
Comment #4
SimonVlc commentedI´ve updated to 6.3.3, but I´m still unable to load correctly the object. This is the error on firebug:
_gat is not definedAny help will be appreciated!
Comment #5
hass commentedYour code is not async. It need to be upgraded.
Comment #6
SimonVlc commentedHi hass,
I´ve installed 6.3.3, run update.php, and everything seems updated (non updates pending).
This is the analytics code that appears on my page (without the flowplayer js added):
So, please hass, what are you telling when talk about 'it need to be upgraded'? Thanks in advance!
Comment #7
hass commentedThis is *synchronous* code and needs to be upgraded to async and above is invalid with async GA versions. This is why nothing gets logged.
Comment #8
SimonVlc commentedThanks for your help hass, you were rigth ;).
For reference, this is the async version of the code:
_gaq.push(['_tracker._setAccount', 'UA-xxxxx-xx']);Comment #9
hass commentedAside you schould be able to push an event without creating a new tracker, but you may track it in different accounts and therefore it may be required.