Just may be too late also I may not have enough time to explain this however onces you set up your event tracking event try this;
//GA SetUp
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write("<script src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'>" + "</sc" + "ript>");
var pageTracker = _gat._getTracker("UA-xxxx-x");
pageTracker._initData();
pageTracker._trackPageview();
// Create the event tracking object
var ytpEventTracker = pageTracker._createEventTracker("YouTube Video Player");
var eventLabel;
var nowPlaying;
function updateHTML(elmId, value) {
document.getElementById(elmId).innerHTML = value;
}
function setytplayerState(newState) {
updateHTML("playerstate", newState);
if (translateYTPState(newState) == 'ended' && parseInt(getCurrentTime()) > 0) {
recordEnd(eventLabel,parseInt(getCurrentTime()));
}
}
function onYouTubePlayerReady(playerId) {
ytplayer = document.getElementById("myytplayer");
setInterval(updateytplayerInfo, 250);
updateytplayerInfo();
ytplayer.addEventListener("onStateChange", "onytplayerStateChange");
ytpEventTracker._trackEvent("Player Loaded", eventLabel);
}
function onytplayerStateChange(newState) {
setytplayerState(newState);
}
function translateYTPState(state) {
switch (state) {
case -1: return "unstarted";
case 0 : return "ended";
case 1 : return "playing";
case 2 : return "paused";
case 3 : return "buffering";
case 5 : return "video cued";
}
return;
}
function onPlayerError(errorCode) {
alert("An error occurred: "+ errorCode);
ytpEventTracker._trackEvent("Error: " + errorCode, eventLabel);
}
function updateytplayerInfo() {
updateHTML("bytesloaded", getBytesLoaded());
updateHTML("bytestotal", getBytesTotal());
updateHTML("videoduration", getDuration());
updateHTML("videotime", getCurrentTime());
updateHTML("startbytes", getStartBytes());
updateHTML("volume", getVolume());
}
// functions for the api calls
function loadNewVideo(id, startSeconds) {
if (ytplayer) {
ytplayer.loadVideoById(id, startSeconds);
}
}
function cueNewVideo(id, startSeconds) {
if (ytplayer) {
ytplayer.cueVideoById(id, startSeconds);
}
}
function startNewVideo () {
// if there is a current video playing, record the end
var oldTime = parseInt(getCurrentTime());
var oldEventLabel = eventLabel;
if (oldTime > 0) {
recordEnd(oldEventLabel, oldTime);
}
eventLabel = document.getElementById('loadvideoid').options[document.getElementById('loadvideoid').selectedIndex].text;
loadNewVideo(document.getElementById('loadvideoid').value, 0);
ytpEventTracker._trackEvent("Video Started", eventLabel);
}
function recordEnd(l,t) {
ytpEventTracker._trackEvent("Ended", l, parseInt(t));
}
function play() {
if (ytplayer) {
ytplayer.playVideo();
ytpEventTracker._trackEvent("Play",eventLabel);
}
}
function pause() {
if (ytplayer) {
ytplayer.pauseVideo();
ytpEventTracker._trackEvent("Pause",eventLabel);
}
}
function stop() {
if (ytplayer) {
ytplayer.stopVideo();
ytpEventTracker._trackEvent("Stop",eventLabel);
}
}
function getPlayerState() {
if (ytplayer) {
return ytplayer.getPlayerState();
}
}
function seekTo(seconds) {
if (ytplayer) {
ytplayer.seekTo(seconds, true);
ytpEventTracker._trackEvent("Seek To: " + seconds, eventLabel);
}
}
function getBytesLoaded() {
if (ytplayer) {
return ytplayer.getVideoBytesLoaded();
}
}
function getBytesTotal() {
if (ytplayer) {
return ytplayer.getVideoBytesTotal();
}
}
function getCurrentTime() {
if (ytplayer) {
return ytplayer.getCurrentTime();
}
}
function getDuration() {
if (ytplayer) {
return ytplayer.getDuration();
}
}
function getStartBytes() {
if (ytplayer) {
return ytplayer.getVideoStartBytes();
}
}
function mute() {
if (ytplayer) {
ytplayer.mute();
ytpEventTracker._trackEvent("Mute",eventLabel);
}
}
function unMute() {
if (ytplayer) {
ytplayer.unMute();
ytpEventTracker._trackEvent("Unmute",eventLabel);
}
}
function getEmbedCode() {
alert(ytplayer.getVideoEmbedCode());
ytpEventTracker._trackEvent("Get Embed Code", eventLabel);
}
function getVideoUrl() {
alert(ytplayer.getVideoUrl());
ytpEventTracker._trackEvent("Get Video URL", eventLabel);
}
function setVolume(newVolume) {
if (ytplayer) {
ytplayer.setVolume(newVolume);
}
}
function getVolume() {
if (ytplayer) {
return ytplayer.getVolume();
}
}
function clearVideo() {
if (ytplayer) {
ytplayer.clearVideo();
}
}