Permalink
Browse files

adding in google analytics & quantcast codes. new hc.yml.dist file fo…

…r some app specific options
  • Loading branch information...
1 parent 4107bba commit 055ea181a35ba956a4892d4b5b451cc95361176f @jgilliam committed Mar 30, 2009
View
@@ -2,4 +2,4 @@
log/*
tmp/**/*
config/database.yml
-
+config/hc.yml
View
2 README
@@ -10,7 +10,7 @@ git clone git://github.com/jgilliam/hellocongress.git
git submodule init
git submodule update
-You will need to copy database.yml.dist to database.yml and set your database settings like you would any Rails app.
+You will need to copy database.yml.dist to database.yml and set your database settings like you would any Rails app. Also copy hc.yml.dist to hc.yml and add in your own Google Analytics code, etc.
This will create the database, run the migrations, and set up the initial data:
@@ -52,5 +52,7 @@
</div>
</div>
+<%= render :partial => "shared/analytics" %>
+
</body>
</html>
@@ -84,5 +84,7 @@
</div>
</div>
+<%= render :partial => "shared/analytics" %>
+
</body>
</html>
@@ -30,5 +30,7 @@
</div>
</div>
+<%= render :partial => "shared/analytics" %>
+
</body>
</html>
@@ -0,0 +1,28 @@
+<% if HC_CONFIG['google_analytics_code']%>
+
+<script type="text/javascript">
+var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+</script>
+<script type="text/javascript">
+var pageTracker = _gat._getTracker("<%= HC_CONFIG['google_analytics_code'] %>");
+pageTracker._setDomainName(".hellocongress.org");
+<% if current_legislator %>
+pageTracker._setVar('<%= current_legislator.short_name %>');
+<% end %>
+pageTracker._trackPageview();
+</script>
+
+<% end %>
+
+<% if HC_CONFIG['quantcast_code']%>
+<script type="text/javascript">
+_qoptions={
+qacct:"<%= HC_CONFIG['quantcast_code'] %>"
+};
+</script>
+<script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script>
+<noscript>
+<img src="http://pixel.quantserve.com/pixel/<%= HC_CONFIG['quantcast_code'] %>.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/>
+</noscript>
+<% end %>
View
@@ -0,0 +1,2 @@
+google_analytics_code: UA-2839551-7
+quantcast_code: p-5ftmjaPECGTTU
@@ -0,0 +1 @@
+HC_CONFIG = YAML.load_file("#{RAILS_ROOT}/config/hc.yml")

0 comments on commit 055ea18

Please sign in to comment.