Это действительно была проблема с неопределенными переменными JavaScript. Решение было.
В голове:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXXX-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<!-- delay to ensure that events are tracked http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55527-->
<script type="text/javascript">
function recordOutboundLink(link, trackEvent, category, action) {
_gat._getTrackerByName()._trackEvent(trackEvent, category, action);
setTimeout('document.location = "' + link.href + '"', 100);
}
</script>
<script type="text/javascript">
function recordOutboundLink(link, trackEvent, category, action) {
_gat._getTrackerByName()._trackEvent(trackEvent, category, action);
setTimeout('document.location = "' + link.href + '"', 100);
}
</script>
По ссылке:
<a href="download.php" id="download" class="download" name="Constant Reminder Ringtone" onClick="recordOutboundLink(this, 'Files', 'Download', 'Constant Reminder Ringtone');return false;">DOWNLOAD</a>