A client has a site where video content is populated by AJAX from a video CDN. Each link is built like so:
<a class="thumb-link" href="/?video='.$video->id.'" onclick="show_video('.$video->id.', \''.$section.'\'); return false;"><img src="'.$thumb.'" width="100" height="65" alt="" align="left" /></a>
But they report that analytics is not tracking the href, since the onclick is telling a Flash player to load the content via javascript instead of go to a page and load the video.
What can I do (without going to a physical page) to track this click as if they clicked through to a page?
Can I add to the onclick and do something like:
Add to the anchor: onclick="trackVideo();"
Then, with javascript:
function trackVideo() {
path = $(this).attr("href");
var pageTracker = _gat._getTracker("UA-XXXXX-XX");
pageTracker._trackPageview(path);
}
I am not too familiar with Analytics, so if someone could get me in the right direction that would be great.