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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa4fc26301804b4d75607cb40fe4ae52be8a80fa
|
4
|
+
data.tar.gz: 166a964cf4baab301dc90defc2aa6dd842a190e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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: "
|
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" -%>
|
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.
|
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:
|
11
|
+
date: 2018-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: scrivito_sdk
|