<?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: Google Analytics and Rails in 60 Seconds</title>
	<atom:link href="http://www.mendable.com/google-analytics-and-rails-in-60-seconds/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mendable.com/google-analytics-and-rails-in-60-seconds/</link>
	<description>Mendable.com - Essential Reading for Ruby on Rails Developers</description>
	<lastBuildDate>Wed, 28 Jul 2010 07:26:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: admin</title>
		<link>http://www.mendable.com/google-analytics-and-rails-in-60-seconds/comment-page-1/#comment-23</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Wed, 08 Jul 2009 22:15:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.mendable.com/?p=167#comment-23</guid>
		<description>Partial&#039;s would also work.

My solution for never having my own visits being tracked by Google analytics has always been to add an entry to my /etc/hosts file:

----
127.0.0.1 www.google-analytics.com
127.0.0.1 ssl.google-analytics.com
----

That way I don&#039;t need to worry about writing different code for different environments. This also has the advantage that my own visit&#039;s to a production site are never recorded either. For new sites that can be statistically significant in the beginning. Sorry, I should have mentioned I do that.</description>
		<content:encoded><![CDATA[<p>Partial&#8217;s would also work.</p>
<p>My solution for never having my own visits being tracked by Google analytics has always been to add an entry to my /etc/hosts file:</p>
<p>&#8212;-<br />
127.0.0.1 <a href="http://www.google-analytics.com" rel="nofollow">http://www.google-analytics.com</a><br />
127.0.0.1 ssl.google-analytics.com<br />
&#8212;-</p>
<p>That way I don&#8217;t need to worry about writing different code for different environments. This also has the advantage that my own visit&#8217;s to a production site are never recorded either. For new sites that can be statistically significant in the beginning. Sorry, I should have mentioned I do that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaime Iniesta</title>
		<link>http://www.mendable.com/google-analytics-and-rails-in-60-seconds/comment-page-1/#comment-21</link>
		<dc:creator>Jaime Iniesta</dc:creator>
		<pubDate>Wed, 08 Jul 2009 18:34:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.mendable.com/?p=167#comment-21</guid>
		<description>You can also save the analytics html code on a partial, for instance on &#039;app/views/shared/_analytics.html.erb&#039; and include it on the layouts that use it like:

&lt;%= render :partial =&gt; &#039;shared/analytics&#039; %&gt;

Also, you should only include the analytics code on the production environment, so what I prefer to do is this:

&lt;%= render :partial =&gt; &#039;shared/analytics&#039; if RAILS_ENV == &#039;production&#039; %&gt;</description>
		<content:encoded><![CDATA[<p>You can also save the analytics html code on a partial, for instance on &#8216;app/views/shared/_analytics.html.erb&#8217; and include it on the layouts that use it like:</p>
<p>&lt;%= render :partial => &#8217;shared/analytics&#8217; %&gt;</p>
<p>Also, you should only include the analytics code on the production environment, so what I prefer to do is this:</p>
<p>&lt;%= render :partial => &#8217;shared/analytics&#8217; if RAILS_ENV == &#8216;production&#8217; %&gt;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Backeus</title>
		<link>http://www.mendable.com/google-analytics-and-rails-in-60-seconds/comment-page-1/#comment-20</link>
		<dc:creator>David Backeus</dc:creator>
		<pubDate>Wed, 08 Jul 2009 18:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.mendable.com/?p=167#comment-20</guid>
		<description>I would use a partial inside the layouts directory for this. No reason to pollute the application_helper since there is no actual logic to it. And html in strings doesn&#039;t look very nice in my opinion.</description>
		<content:encoded><![CDATA[<p>I would use a partial inside the layouts directory for this. No reason to pollute the application_helper since there is no actual logic to it. And html in strings doesn&#8217;t look very nice in my opinion.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
