<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using Google Analytics Event API to track your website performance</title>
	<atom:link href="http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=using-google-analytics-event-api-to-track-your-website-performance</link>
	<description>Java, Web 2.0 and other Tech topics</description>
	<lastBuildDate>Thu, 09 Feb 2012 08:01:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: משחקים</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-32480</link>
		<dc:creator>משחקים</dc:creator>
		<pubDate>Tue, 12 Apr 2011 04:09:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-32480</guid>
		<description>This is amazing! i have added it to my favorites.</description>
		<content:encoded><![CDATA[<p>This is amazing! i have added it to my favorites.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Eggum</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-22400</link>
		<dc:creator>Thomas Eggum</dc:creator>
		<pubDate>Mon, 17 Jan 2011 16:34:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-22400</guid>
		<description>Thank you for the reply :)

This would work, but it will not include the time for the response to travel up the filter chain again. So if you do any post processing in any filters (code that runs after chain.doFilter() ), the time that it uses will not be included.

Many filters use post-actions oscache is one of them, take a look at http://kickjava.com/src/com/opensymphony/oscache/web/filter/CacheFilter.java.htm 

To solve this, you are forced to use a wrapper and record the total time, i.e:
Time from you hit the first filter, goes down the chain to the Servlet/JSP, and then moves back up the filter chain.</description>
		<content:encoded><![CDATA[<p>Thank you for the reply <img src='http://www.vineetmanohar.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This would work, but it will not include the time for the response to travel up the filter chain again. So if you do any post processing in any filters (code that runs after chain.doFilter() ), the time that it uses will not be included.</p>
<p>Many filters use post-actions oscache is one of them, take a look at <a href="http://kickjava.com/src/com/opensymphony/oscache/web/filter/CacheFilter.java.htm" rel="nofollow">http://kickjava.com/src/com/opensymphony/oscache/web/filter/CacheFilter.java.htm</a> </p>
<p>To solve this, you are forced to use a wrapper and record the total time, i.e:<br />
Time from you hit the first filter, goes down the chain to the Servlet/JSP, and then moves back up the filter chain.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vineet</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-21725</link>
		<dc:creator>vineet</dc:creator>
		<pubDate>Tue, 11 Jan 2011 15:43:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-21725</guid>
		<description>@dclairac: Even though the code in footer is javascript code, the code itself is created by a JSP or a servlet which will run in the chain.doFilter() method, and will be written before the finally block is called. That&#039;s why the code would not work.

@Thomas Eggum: Great observation, this code will not work. I had actually fixed the code, but forgot to post an update. Your approach works too (creating a StringWrapper). I chose a much simpler approach. Just before chain.doFilter(), store the &quot;START_TIME&quot; in the request.
 &lt;code&gt;
  request.setAttribute(&quot;START_TIME&quot;, 
                            startTime);
  filter.doChain();  
&lt;/code&gt;

In the JSP:
&lt;code&gt;
&lt;%
   Date startTime = (Date) request.getAttribute(&quot;START_TIME&quot;);
   Date endTime = new Date();
   pageTracker._trackEvent(&quot;Response time&quot;,  
                                   &quot;&lt;sub section name of the website&gt;&quot;,  
                                   &quot;&lt;%=uri%&gt;&quot;,  
                                   &quot;&lt;%= (endTime - startTime) %&gt;&quot;);  
%&gt;
&lt;/code&gt;

The only downside of this approach is that it calculates the time it took from the beginning of the page to that line, so you have to place the line at the bottom of your page.</description>
		<content:encoded><![CDATA[<p>@dclairac: Even though the code in footer is javascript code, the code itself is created by a JSP or a servlet which will run in the chain.doFilter() method, and will be written before the finally block is called. That&#8217;s why the code would not work.</p>
<p>@Thomas Eggum: Great observation, this code will not work. I had actually fixed the code, but forgot to post an update. Your approach works too (creating a StringWrapper). I chose a much simpler approach. Just before chain.doFilter(), store the &#8220;START_TIME&#8221; in the request.<br />
 <code><br />
  request.setAttribute("START_TIME",<br />
                            startTime);<br />
  filter.doChain();<br />
</code></p>
<p>In the JSP:<br />
<code><br />
< %<br />
   Date startTime = (Date) request.getAttribute("START_TIME");<br />
   Date endTime = new Date();<br />
   pageTracker._trackEvent("Response time",<br />
                                   "<sub section name of the website>",<br />
                                   "< %=uri%>",<br />
                                   "< %= (endTime - startTime) %>");<br />
%><br />
</code></p>
<p>The only downside of this approach is that it calculates the time it took from the beginning of the page to that line, so you have to place the line at the bottom of your page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dclairac</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-21685</link>
		<dc:creator>dclairac</dc:creator>
		<pubDate>Tue, 11 Jan 2011 09:23:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-21685</guid>
		<description>@Thomas Eggum
Code in footer is javascript code. It will be run on browser (after the end of java filter execution).
Header RESPONSE_TIME will be available.</description>
		<content:encoded><![CDATA[<p>@Thomas Eggum<br />
Code in footer is javascript code. It will be run on browser (after the end of java filter execution).<br />
Header RESPONSE_TIME will be available.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas Eggum</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-21571</link>
		<dc:creator>Thomas Eggum</dc:creator>
		<pubDate>Mon, 10 Jan 2011 13:35:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-21571</guid>
		<description>Hi, and thank you for a informative post about performing response time tracking!

As far as I can see this example will not work, because the code in your footer will run before the code after chain.doFilter(request, response) in the filter, thus the request-attribute &quot;RESPONSE_TIME&quot; will not be available. 

I would suggest to use a StringWrapper to pass down the filter chain to enable inserting of the JavaScript with &quot;pageTracker._trackEvent&quot; when the chain.doFilter(request, response) returns in the filter.</description>
		<content:encoded><![CDATA[<p>Hi, and thank you for a informative post about performing response time tracking!</p>
<p>As far as I can see this example will not work, because the code in your footer will run before the code after chain.doFilter(request, response) in the filter, thus the request-attribute &#8220;RESPONSE_TIME&#8221; will not be available. </p>
<p>I would suggest to use a StringWrapper to pass down the filter chain to enable inserting of the JavaScript with &#8220;pageTracker._trackEvent&#8221; when the chain.doFilter(request, response) returns in the filter.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aleta Weibe</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-5361</link>
		<dc:creator>Aleta Weibe</dc:creator>
		<pubDate>Wed, 21 Apr 2010 13:08:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-5361</guid>
		<description>Extremely interesting post thanks for sharing I have added your blog to my bookmarks and will check back.</description>
		<content:encoded><![CDATA[<p>Extremely interesting post thanks for sharing I have added your blog to my bookmarks and will check back.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hector Hurtado</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-4148</link>
		<dc:creator>Hector Hurtado</dc:creator>
		<pubDate>Mon, 25 Jan 2010 15:18:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-4148</guid>
		<description>Hi,

While it&#039;s true that your method is great to chart website performance, you should be aware that an event automatically triggered on every page counts as a gif request to Google analytics, and will therefore always generate a bounce rate of 0%, which is not ideal in a production environment.

Hope this helps.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>While it&#8217;s true that your method is great to chart website performance, you should be aware that an event automatically triggered on every page counts as a gif request to Google analytics, and will therefore always generate a bounce rate of 0%, which is not ideal in a production environment.</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-604</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 21 May 2009 18:58:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-604</guid>
		<description>According to google: The Event Tracking feature is currently in limited release. If you would like to have the feature enabled in your account, please fill out this request form. This process may take 3-5 business days to complete.
http://spreadsheets.google.com/viewform?key=p7DycufUwNgmtunKEtgNGBg&amp;hl=en</description>
		<content:encoded><![CDATA[<p>According to google: The Event Tracking feature is currently in limited release. If you would like to have the feature enabled in your account, please fill out this request form. This process may take 3-5 business days to complete.<br />
<a href="http://spreadsheets.google.com/viewform?key=p7DycufUwNgmtunKEtgNGBg&#038;hl=en" rel="nofollow">http://spreadsheets.google.com/viewform?key=p7DycufUwNgmtunKEtgNGBg&#038;hl=en</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eduardo</title>
		<link>http://www.vineetmanohar.com/2009/03/using-google-analytics-event-api-to-track-your-website-performance/comment-page-1/#comment-603</link>
		<dc:creator>eduardo</dc:creator>
		<pubDate>Thu, 21 May 2009 18:15:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.vineetmanohar.com/blog/?p=3#comment-603</guid>
		<description>Hi, buddy ... what if my account is not showing trackevent? What can I do? Thanks ...</description>
		<content:encoded><![CDATA[<p>Hi, buddy &#8230; what if my account is not showing trackevent? What can I do? Thanks &#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

