onload and onunload JavaScript events with GA time tracker
<pre><code>&lt;html&gt;  
&lt;head&gt;  
&lt;title&gt;Latency Tracking Demo&lt;/title&gt;  
&lt;/head&gt;  
&lt;body&gt;  
&lt;script type="text/javascript" src="http://www.google-analytics.com/ga.js"&gt;&lt;/script&gt;  
&lt;script type="text/javascript" src="http://www.example.com/scripts/time-tracker.js"&gt;&lt;/script&gt;  
&lt;script type="text/javascript"&gt;  
var timeTracker = new TimeTracker();  
var pageTracker = _gat._getTracker('UA-1735986-1');   
&lt;/script&gt;  
&lt;input type="button" value="Start Timer" onclick="timeTracker._recordStartTime();"/&gt;  
&lt;input type="button" value="Stop Timer" onclick="timeTracker._recordEndTime();"/&gt;  
&lt;input type="button" value="Track!" onclick="timeTracker._track(pageTracker, undefined, 'Manual Test');"/&gt;  
&lt;/body&gt;  
&lt;/html&gt;
</code></pre>

<p>I am trying to apply this concept on onload JavaScript event as Start Time and onunload as Stop time , like</p>

<pre><code>  onload="timeTracker._recordStartTime();"
    onunload="timeTracker._recordEndTime(); timeTracker._track(pageTracker, 'Category','Action');"
</code></pre>

<p>But have not get it work ..and even not error was thrown </p>

<p>any idea </p>
