ganalytics 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ef44f6ce6f8a65804983fd2b7243b5bf12cf9d45
4
+ data.tar.gz: 328fb5e20d7395de810982418c368ec35d7f923f
5
+ SHA512:
6
+ metadata.gz: f0995f7cbd96f9ae7931c245309b032feca0fc4b74d5dbc97b987f7c3eca8307c7a8b71134d2dc9150c28e4272c6a6b285d337ed2441b8e9f148c0557126762e
7
+ data.tar.gz: e7fb2e1b8374019671a9705ed7b4cd3b0b5fd4fa917888b5475c0442884465f8126b7540be225977b7d7182a5f9ece7f1d1348b1aeb4a7a2f0014c176c8d9047
@@ -3,18 +3,19 @@ module Ganalytics
3
3
  def add_google_analytics
4
4
  return unless (Ganalytics.google_tracking_id.present? and request.env['SERVER_NAME'] != 'localhost')
5
5
 
6
- google_code = "<script type=\"text/javascript\">
7
- var _gaq = _gaq || [];
8
- _gaq.push(['_setAccount', '#{Ganalytics.google_tracking_id}']);
9
- _gaq.push(['_trackPageview']);
6
+ google_code = "
7
+ <!-- Google Analytics -->
8
+ <script>
9
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
10
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
11
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
12
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
10
13
 
11
- (function() {
12
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
13
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
14
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
15
- })();
14
+ ga('create', '#{Ganalytics.google_tracking_id}', 'auto');
15
+ ga('send', 'pageview');
16
16
 
17
- </script>"
17
+ </script>
18
+ <!-- End Google Analytics -->"
18
19
  response.body = response.body.sub(/<\/head>/, "#{google_code}</head>")
19
20
  end
20
21
  end
@@ -1,3 +1,3 @@
1
1
  module Ganalytics
2
- VERSION = "0.0.12"
2
+ VERSION = "0.0.13"
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ganalytics
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
5
- prerelease:
4
+ version: 0.0.13
6
5
  platform: ruby
7
6
  authors:
8
7
  - Lilibeth De La Cruz
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-05-24 00:00:00.000000000 Z
11
+ date: 2014-02-01 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Add Google Analytics to all pages of a website
15
14
  email:
@@ -18,7 +17,7 @@ executables: []
18
17
  extensions: []
19
18
  extra_rdoc_files: []
20
19
  files:
21
- - .gitignore
20
+ - ".gitignore"
22
21
  - Gemfile
23
22
  - LICENSE
24
23
  - README.md
@@ -31,26 +30,25 @@ files:
31
30
  - lib/ganalytics/version.rb
32
31
  homepage: https://github.com/lilibethdlc/ganalytics
33
32
  licenses: []
33
+ metadata: {}
34
34
  post_install_message:
35
35
  rdoc_options: []
36
36
  require_paths:
37
37
  - lib
38
38
  required_ruby_version: !ruby/object:Gem::Requirement
39
- none: false
40
39
  requirements:
41
- - - ! '>='
40
+ - - ">="
42
41
  - !ruby/object:Gem::Version
43
42
  version: '0'
44
43
  required_rubygems_version: !ruby/object:Gem::Requirement
45
- none: false
46
44
  requirements:
47
- - - ! '>='
45
+ - - ">="
48
46
  - !ruby/object:Gem::Version
49
47
  version: '0'
50
48
  requirements: []
51
49
  rubyforge_project:
52
- rubygems_version: 1.8.23
50
+ rubygems_version: 2.2.1
53
51
  signing_key:
54
- specification_version: 3
52
+ specification_version: 4
55
53
  summary: Add Google Analytics to all pages of a website
56
54
  test_files: []