Skip to content

Commit

Permalink
Added Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Kao authored and Jeff Kao committed Aug 23, 2012
1 parent 4f31151 commit 17a66de
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/views/layouts/_ga.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- if show
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-34285776-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' : 'https://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
4 changes: 4 additions & 0 deletions app/views/layouts/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
%title
#{yield(:title).empty? ? default_title : yield(:title)} | Mediac

= favicon_link_tag

%meta{ :name => "description",
:content => "Mediac is a web platform for sharing and keeping track of awesome Internet content! Never lose track of your bookmarks and discover new things to digest." }

Expand All @@ -23,6 +25,8 @@
= javascript_include_tag "application"
= csrf_meta_tags

= render :partial => "layouts/ga", :locals => { :show => Rails::env == "production" }

%body{ :id => wallpaper_id }
- if !signed_in?
= render :partial => "sessions/sign_in_dialog"
Expand Down
6 changes: 5 additions & 1 deletion app/views/layouts/share.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@
%title
#{yield(:title).empty? ? default_title : yield(:title)} | Mediac
- # TODO: Use Bookmark Specific Attributes

= favicon_link_tag

%meta{ :name => "description",
:content => "Mediac is a web platform for sharing and keeping track of awesome Internet content! Never lose track of your bookmarks and discover new things to digest." }

%meta{ :property => "og:title", :content => "#{yield(:title).empty? ? default_title : yield(:title)}"}
%meta{ :property => "og:type", :content => "website"}
%meta{ :property => "og:image", :content => ""}
%meta{ :property => "og:url", :content => "https://mediac.co"}
%meta{ :property => "og:title", :content => "Mediac"}
%meta{ :property => "og:description", :content => "Mediac is a web platform for sharing and keeping track of awesome Internet content! Never lose track of your bookmarks and discover new things to digest."}
Expand All @@ -20,6 +22,8 @@
= javascript_include_tag "application"
= csrf_meta_tags

= render :partial => "layouts/ga", :locals => { :show => Rails::env == "production" }

%body#share
- if !signed_in?
= render :partial => "sessions/sign_in_dialog"
Expand Down

0 comments on commit 17a66de

Please sign in to comment.