scrivito_seo_page_extender 1.3.1 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd346ac5fe379a8ec5cd0d29f486e38e9dc69577
4
- data.tar.gz: d5b28b0bdfbecf4c30edfb690e3508a7af02b433
3
+ metadata.gz: fa4fc26301804b4d75607cb40fe4ae52be8a80fa
4
+ data.tar.gz: 166a964cf4baab301dc90defc2aa6dd842a190e6
5
5
  SHA512:
6
- metadata.gz: 1ca05442caa5d1cc783f96b19c7983e66d3d47d28d471f4412acb270a666bfc1ba954830028b645586a430d99b120f57397402b2f935ba2cf4b945b4c883a893
7
- data.tar.gz: aa900274e25b19ea3183430111ec92e5be6dd3cd5f482bc7cc8a3c17b817f139ae3fb9ed6aeaeb50b3eabda8fbeab4e855e6677113ade40224117581bca784c7
6
+ metadata.gz: 41d0d93602404a2efe77668e2cbc500ae1868c890fdd3ad3b296fc9dac181d1cc92ce0d5dd679dfb18b3b9710f98b2a09316c9efb488cf59036cb53b60c93be7
7
+ data.tar.gz: a350bc2fbb7c529bbdb91ca45a8739f8b64f636fb5e9e1dab6812ceb13b2b4120bbe7691fa39a9f867db53ead442bda73edfe1329cced69cb5c525a74aa211f2
data/README.md CHANGED
@@ -123,7 +123,7 @@ The word density plugin lowercases your content. Therefore, the words in your st
123
123
 
124
124
  ### Google analytics
125
125
 
126
- The partial that adds the standard implemetation of Google Analytics to your view can be rendered like this:
126
+ The partial, that adds the asnychronous implemetation of Google Analytics to your view, can be rendered like this:
127
127
 
128
128
  ```xml
129
129
  <%= render 'seo_page_extender/google_analytics', key: 'your-googleAnalytics-key' %>
@@ -131,6 +131,20 @@ The partial that adds the standard implemetation of Google Analytics to your vie
131
131
 
132
132
  `anonymize-ip` has been set to `true` in this script.
133
133
 
134
+ The partial also brings in the function to set a opt-out cookie. You can then place a link on your page, which the visitor can use to set this cookie.
135
+
136
+ Use it with a simple link:
137
+
138
+ ```xml
139
+ <%= link_to 'javascript:gaOptout()', 'Deactivate Google Analytics' %>
140
+ ```
141
+
142
+ Create an additional alert window in the browser:
143
+
144
+ ```xml
145
+ <%= link_to 'javascript:gaOptout()', 'Deactivate Google Analytics', onclick: "alert('Google Analytics has been deactivated.')" %>
146
+ ```
147
+
134
148
  ### Canonical link
135
149
 
136
150
  By default, the canonical link is determined using `scrivito_path`.
@@ -1,9 +1,24 @@
1
1
  <script>
2
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
3
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
4
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
5
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
2
+ // Set to the same value as the web property used on the site
3
+ var gaProperty = "<%= key %>";
4
+
5
+ // Disable tracking if the opt-out cookie exists.
6
+ var disableStr = 'ga-disable-' + gaProperty;
7
+ if (document.cookie.indexOf(disableStr + '=true') > -1) {
8
+ window[disableStr] = true;
9
+ }
10
+
11
+ // Opt-out function
12
+ function gaOptout() {
13
+ document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
14
+ window[disableStr] = true;
15
+ }
16
+
17
+ window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
18
+
6
19
  ga('create', "<%= key %>", 'auto');
7
20
  ga('set', 'anonymizeIp', true);
8
21
  ga('send', 'pageview');
9
22
  </script>
23
+
24
+ <%= javascript_include_tag 'https://www.google-analytics.com/analytics.js', async: true %>
@@ -3,7 +3,7 @@
3
3
  <%= render "seo_page_extender/meta_robots", attribute: "meta_robots" -%>
4
4
  <%= render "seo_page_extender/meta_attribute", attribute: "meta_author", name: "author" -%>
5
5
  <%= render "seo_page_extender/meta_attribute", attribute: "meta_publisher", name: "publisher" -%>
6
- <%= render "seo_page_extender/meta_attribute", attribute: "meta_page_type", name: "pat_type" -%>
6
+ <%= render "seo_page_extender/meta_attribute", attribute: "meta_page_type", name: "page_type" -%>
7
7
  <%= render "seo_page_extender/meta_attribute", attribute: "meta_page_topic", name: "page_topic" -%>
8
8
  <%= render "seo_page_extender/meta_attribute", attribute: "meta_audience", name: "audience" -%>
9
9
  <%= render "seo_page_extender/meta_attribute", attribute: "meta_copyright", name: "copyright" -%>
@@ -1,3 +1,3 @@
1
1
  module ScrivitoSeoPageExtender
2
- VERSION = "1.3.1"
2
+ VERSION = "1.4.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scrivito_seo_page_extender
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.1
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scrivito
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-03 00:00:00.000000000 Z
11
+ date: 2018-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: scrivito_sdk