Commit 3ca4061933fa7430b2c40dd115772808a0ebfe6d
Committed by
gtaaas
1 parent
c02e9564
Exists in
master
and in
1 other branch
Adiciona código do Google Analytics
Showing
3 changed files
with
34 additions
and
15 deletions
Show diff stats
app/views/layouts/admin.html.erb
1 | -<!-- | |
2 | -# | |
3 | -# Author Igor Amorim - www.igoramorim.com | |
4 | -# | |
5 | ---> | |
6 | 1 | <!DOCTYPE html> |
7 | 2 | <html> |
8 | 3 | <head> |
... | ... | @@ -10,6 +5,18 @@ |
10 | 5 | <%= stylesheet_link_tag "application", :media => "all" %> |
11 | 6 | <%= javascript_include_tag "application" %> |
12 | 7 | <%= csrf_meta_tags %> |
8 | + <% if Rails.env.production? %> | |
9 | + <script> | |
10 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
11 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
12 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
13 | + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
14 | + | |
15 | + ga('create', 'UA-22403694-4', 'ufpb.br'); | |
16 | + ga('send', 'pageview'); | |
17 | + </script> | |
18 | + <% end %> | |
19 | + | |
13 | 20 | </head> |
14 | 21 | <body> |
15 | 22 | <div class="navbar navbar-fixed-top"> | ... | ... |
app/views/layouts/application.html.erb
1 | -<!-- | |
2 | -# | |
3 | -# Author Igor Amorim - www.igoramorim.com | |
4 | -# | |
5 | ---> | |
6 | 1 | <!DOCTYPE html> |
7 | 2 | <html> |
8 | 3 | <head> |
... | ... | @@ -10,6 +5,17 @@ |
10 | 5 | <%= stylesheet_link_tag "application", :media => "all" %> |
11 | 6 | <%= javascript_include_tag "application" %> |
12 | 7 | <%= csrf_meta_tags %> |
8 | + <% if Rails.env.production? %> | |
9 | + <script> | |
10 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
11 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
12 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
13 | + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
14 | + | |
15 | + ga('create', 'UA-22403694-4', 'ufpb.br'); | |
16 | + ga('send', 'pageview'); | |
17 | + </script> | |
18 | + <% end %> | |
13 | 19 | </head> |
14 | 20 | <body> |
15 | 21 | <div class="navbar navbar-fixed-top"> | ... | ... |
app/views/layouts/login.html.erb
1 | -<!-- | |
2 | -# | |
3 | -# Author Igor Amorim - www.igoramorim.com | |
4 | -# | |
5 | ---> | |
6 | 1 | <!DOCTYPE html> |
7 | 2 | <html> |
8 | 3 | <head> |
... | ... | @@ -10,6 +5,17 @@ |
10 | 5 | <%= stylesheet_link_tag "application", :media => "all" %> |
11 | 6 | <%= javascript_include_tag "application" %> |
12 | 7 | <%= csrf_meta_tags %> |
8 | + <% if Rails.env.production? %> | |
9 | + <script> | |
10 | + (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
11 | + (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
12 | + m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
13 | + })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
14 | + | |
15 | + ga('create', 'UA-22403694-4', 'ufpb.br'); | |
16 | + ga('send', 'pageview'); | |
17 | + </script> | |
18 | + <% end %> | |
13 | 19 | </head> |
14 | 20 | <body> |
15 | 21 | <div class="navbar navbar-fixed-top"> | ... | ... |