2011-09-28 69 views

回答

3

更新GA implementation如下:

ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]); 

實施例:

google.maps.event.addListener(marker, 'click', function() { 
    ga('send', 'event', 'Videos', 'play', 'Fall Campaign'); 
    infoWindow.setContent(html); 
    infoWindow.open(map, marker); 
}); 
1

我不知道爲什麼這不是更好的記錄,但這是我最終如何得到它的工作。將gaq.push添加到標記點擊的addListener函數中。請參閱由antyrat鏈接的文檔。

google.maps.event.addListener(marker, 'click', function() { 
    gaq.push(['_trackEvent', 'category', 'action', 'opt_label']); 
    infoWindow.setContent(html); 
    infoWindow.open(map, marker); 
});