Multiplat / ga-youtube-tracker

Automatically exported from code.google.com/p/ga-youtube-tracker
0 stars 0 forks source link

Not compatible with asynchronous tracking. #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The _gat global object is used to create and retrieve tracker ojbects. The _gaq 
global object is for asynchronous tracking. This library currently depends on 
_gat which is not present when asynchronous tracking is implemented.  Point 
this out in the docs and modify the code to make compatible if possible.

Original issue reported on code.google.com by jdug...@sonatype.com on 5 Jun 2011 at 3:18

GoogleCodeExporter commented 8 years ago
Is asynchronous compatible code on the horizon? Thanks, btw - great stuff.

Original comment by trucker...@gmail.com on 4 Aug 2011 at 6:29

GoogleCodeExporter commented 8 years ago
I'm using asynchronous and the following code appears to be working for me...

<!--Youtube tracking component-->
<script 
src="/extension/sonatype/design/sonatype_com/javascript/ga-youtube-tracker/ga_dp
c_youtube.js"></script>
<script>
try{
    function yt_callback(category,action,label,value){
        _gaq.push(['_trackEvent',category,action,label,value]);
    }
    var ytTracker = new YoutubeTracker(false, yt_callback, true);
}catch(e){}
</script>

Original comment by sonat...@gmail.com on 4 Aug 2011 at 7:18

GoogleCodeExporter commented 8 years ago

Original comment by leonardo...@directperformance.com.br on 4 Aug 2011 at 11:39

GoogleCodeExporter commented 8 years ago
thanks guys!

I've just corrected the default tracking to _gaq.
I hope it helps many people trying to use the default tracking.

But, if anyone had implemented Sonat solution, it works well!

Ping me if the correction doesn't works for you!

Original comment by leonardo...@directperformance.com.br on 4 Aug 2011 at 11:42