Skip to content

Commit

Permalink
add privacy policy, cookie policy and cookie consent using osano
Browse files Browse the repository at this point in the history
  • Loading branch information
fethiozdol committed Jul 3, 2024
1 parent 336c66e commit 75f9b8d
Show file tree
Hide file tree
Showing 16 changed files with 410 additions and 11 deletions.
6 changes: 1 addition & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,13 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.3.1)
strscan
rexml (3.2.8)
rouge (4.3.0)
safe_yaml (1.0.5)
sass-embedded (1.77.5)
google-protobuf (>= 3.25, < 5.0)
rake (>= 13)
sass-embedded (1.77.5-arm64-darwin)
google-protobuf (>= 3.25, < 5.0)
sax-machine (1.3.2)
strscan (3.1.0)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
tzinfo (2.0.6)
Expand Down
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ contact_note: >

# For Google Analytics, see https://support.google.com/analytics/answer/10447272?hl=en&ref_topic=14088998&sjid=5129943941510317771-SA#zippy=%2Cgoogle-sites
# and follow the instructions for Google Sites. You will need to create a Google Analytics property and copy the Google tag ID.
google_tag_manager: GTM-WRRMQF2G
google_analytics: G-BFVSGSW9BJ # your Google Analytics measurement ID (format: G-XXXXXXXXXX)
cronitor_analytics: # cronitor RUM analytics site ID (format: XXXXXXXXX)
pirsch_analytics: # your Pirsch analytics site ID (length 32 characters)
Expand Down Expand Up @@ -431,6 +432,9 @@ enable_project_categories: true # enables categorization of projects into multip
enable_medium_zoom: true # enables image zoom feature (as on medium.com)
enable_progressbar: true # enables a horizontal progress bar linked to the vertical scroll position
enable_video_embedding: false # enables video embedding for bibtex entries. If false, the button opens the video link in a new window.
enable_google_tag_manager: true

enable_osano: true

# -----------------------------------------------------------------------------
# Library versions
Expand Down
6 changes: 6 additions & 0 deletions _includes/footer.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
{% endif %}
</div>
{% if site.enable_osano %}
<div id="osano-cookieconsent"></div>
{% endif %}
</footer>
{% else %}
<footer class="sticky-bottom mt-5" role="contentinfo">
Expand All @@ -31,5 +34,8 @@
Last updated: {{ 'now' | date: '%B %d, %Y' }}.
{% endif %}
</div>
{% if site.enable_osano %}
<div id="osano-cookieconsent"></div>
{% endif %}
</footer>
{% endif %}
21 changes: 21 additions & 0 deletions _includes/head.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,27 @@
</script>
{% endif %}

<!-- Osano Cookie Consent -->
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css">
<!-- Osano Cookie Consent -->

<!-- Google Tag Manager -->
{% if site.enable_google_tag_manager %}
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '{{ site.google_tag_manager }}');
</script>
{% endif %}
<!-- End Google Tag Manager -->

<!-- GeoJSON support via Leaflet -->
{% if page.map %}
<link
Expand Down
12 changes: 12 additions & 0 deletions _includes/scripts/analytics.liquid
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
{% if site.enable_google_analytics %}
<!-- Global site tag (gtag.js) - Google Analytics -->
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
window.dataLayer.push(arguments);
}
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
});
</script>
<script async src="https://www.googletagmanager.com/gtag/js?id={{ site.google_analytics }}"></script>
<script>
window.dataLayer = window.dataLayer || [];
Expand Down
12 changes: 12 additions & 0 deletions _includes/scripts/googletagmanager.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% if site.enable_google_tag_manager %}
<!-- Google Tag Manager (noscript) -->
<noscript
><iframe
src="https://www.googletagmanager.com/ns.html?id={{ site.google_tag_manager }}"
height="0"
width="0"
style="display:none;visibility:hidden"
></iframe
></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endif %}
84 changes: 84 additions & 0 deletions _includes/scripts/osano_cookieconsent.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{% if site.enable_osano %}
<!-- Osano Cookie Consent -->
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js"></script>
<script>
function consentAnalyticsStorage() {
gtag('consent', 'update', {
analytics_storage: 'granted',
});
}
function denyAnalyticsStorage() {
gtag('consent', 'update', {
analytics_storage: 'denied',
});
}
window.cookieconsent.initialise({
container: document.getElementById('osano-cookieconsent'),
palette: {
popup: {
background: '#e7c000',
text: '#000',
},
button: {
background: '#009f06',
},
highlight: {
background: '#b71c1c',
},
},
content: {
allow: 'Allow All',
deny: 'Deny',
link: 'Privacy Policy',
href: '/terms/',
header: 'A note to visitors',
message:
'This website uses only necessary and statistics cookies to improve functionality and analyse traffic. It does not use marketing or tracking cookies and it does not process any personally identifiable information. Please visit Privacy Policy page for more details.',
},
elements: {
messagelink:
'<span id="cookieconsent:desc" class="cc-message-custom">\{\{message\}\} <strong><a aria-label="learn more about cookies" tabindex="0" class="cc-link" href="\{\{href\}\}" target="_self">\{\{link\}\}</a></strong></span>',
},
type: 'opt-in',
revokable: true,
animateRevokable: false,
onInitialise: function (status) {
var type = this.options.type;
var didConsent = this.hasConsented();
if (type == 'opt-in' && didConsent) {
// enable cookies
consentAnalyticsStorage();
}
if (type == 'opt-out' && !didConsent) {
// disable cookies
}
},
onStatusChange: function (status, chosenBefore) {
var type = this.options.type;
var didConsent = this.hasConsented();
if (type == 'opt-in' && didConsent) {
// enable cookies
consentAnalyticsStorage();
}
if (type == 'opt-out' && !didConsent) {
// disable cookies
}
},
onRevokeChoice: function () {
var type = this.options.type;
if (type == 'opt-in') {
denyAnalyticsStorage();
}
if (type == 'opt-out') {
// enable cookies
consentAnalyticsStorage();
}
},
law: {
regionalLaw: false,
},
location: true,
});
</script>
<!-- Osano Cookie Consent -->
{% endif %}
2 changes: 2 additions & 0 deletions _layouts/default.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
{% include footer.liquid %}

<!-- JavaScripts -->
{% include scripts/googletagmanager.liquid %}
{% include scripts/jquery.liquid %}
{% include scripts/bootstrap.liquid %}
{% include scripts/masonry.liquid %}
Expand All @@ -67,6 +68,7 @@
{% include scripts/mathjax.liquid %}
{% include scripts/pseudocode.liquid %}
{% include scripts/analytics.liquid %}
{% include scripts/osano_cookieconsent.liquid %}
{% include scripts/progressBar.liquid %}
{% include scripts/wechatModal.liquid %}
{% include scripts/imageLayouts.liquid %}
Expand Down
11 changes: 9 additions & 2 deletions _layouts/page.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@ layout: default
---
<div class="post">
<header class="post-header">
<h1 class="post-title">{{ page.title }}</h1>
<p class="post-description">{{ page.description }}</p>
{% if page.custom_title %}
<h1 class="post-title">{{ page.custom_title }}</h1>
{% else %}

{% endif %}
{% if page.hide_description -%}
{%- else %}
<p class="post-description">{{ page.description }}</p>
{% endif %}
</header>

<article>
Expand Down
138 changes: 138 additions & 0 deletions _pages/cookies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
layout: page
permalink: /cookies/
title: "cookies"
custom_title: "Cookie Policy"
description: "This Cookie Policy outlines the types of cookies used in the website."
nav: true
nav_order: 4
pretty_table: true
---

## 1. Introduction

My website, [https://www.thisismypattern.com](https://www.thisismypattern.com) (hereinafter: “the website”) uses cookies and other related technologies (for convenience all technologies are referred to as “cookies”). In the document below I inform you about the use of cookies on my website.

## 2. What are cookies?

A cookie is a small simple file that is sent along with pages of this website and stored by your browser on the hard drive of your computer or another device. The information stored therein may be returned to my servers or to the servers of the relevant third parties during a subsequent visit.

## 3. What are scripts?

A script is a piece of program code that is used to make my website function properly and interactively. This code is executed on my server or on your device.

## 4. What is a web beacon?

A web beacon (or a pixel tag) is a small, invisible piece of text or image on a website that is used to monitor traffic on a website. In order to do this, various data about you is stored using web beacons.

## 5. Cookies

### 5.1 Technical or functional cookies

Some cookies ensure that certain parts of the website work properly and that your user preferences remain known. By placing functional cookies, I make it easier for you to visit my website. This way, you do not need to repeatedly enter the same information when visiting my website.

### 5.2 Statistics cookies

I use statistics cookies to optimize the website experience for my users. With these statistics cookies I get insights in the usage of my website. I ask your permission to place statistics cookies.

### 5.3 Marketing/Tracking cookies

Marketing/Tracking cookies are cookies or any other form of local storage, used to create user profiles to display advertising or to track the user on this website or across several websites for similar marketing purposes.

**This website does not use any marketing or tracking cookies.**

## 6. Placed cookies

<div class="accordion" id="accordionCookies">
<div class="card">
<div class="card-header" id="headingOne">
<h2 class="mb-0">
<button class="btn btn-link btn-block text-left" type="button" data-toggle="collapse"
data-target="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<div class="d-flex">
<div class="mr-0">
<strong class="text-primary">Google Analytics</strong>
</div>
<div class="ml-auto">
<p class="text-primary" style="font-size: small">Statistics</p>
</div>
</div>
</button>
</h2>
</div>
<div id="collapseOne" class="collapse show" aria-labelledby="headingOne" data-parent="#accordionCookies">
<div class="card-body">
<p><strong>Usage</strong></p>
<p>I use Google Analytics for website statistics. <a target="_blank" rel="noopener noreferrer nofollow"
href="https://cookiedatabase.org/service/google-analytics/">Read more</a></p>
<p><strong>Sharing data</strong></p>
<p>For more information, please read the <a target="_blank" rel="noopener noreferrer nofollow"
href="https://policies.google.com/privacy">Google Analytics Privacy Statement</a>.</p>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th>Expiration</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td markdown="span">
&#95;ga&#95;&#42;&nbsp;
<a class="icon-link" target="_blank" rel="noopener noreferrer nofollow"
href="https://cookiedatabase.org/cookie/google-analytics/_ga_/">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#000" class="bi bi-box-arrow-up-right" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5" /> <path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z" /></svg>
</a>
</td>
<td markdown="span">1 year</td>
<td markdown="span">Store and count pageviews</td>
</tr>
<tr>
<td markdown="span">
&#95;ga&nbsp;
<a class="icon-link" target="_blank" rel="noopener noreferrer nofollow"
href="https://cookiedatabase.org/cookie/google-analytics/_ga/">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="#000" class="bi bi-box-arrow-up-right" viewBox="0 0 16 16"> <path fill-rule="evenodd" d="M8.636 3.5a.5.5 0 0 0-.5-.5H1.5A1.5 1.5 0 0 0 0 4.5v10A1.5 1.5 0 0 0 1.5 16h10a1.5 1.5 0 0 0 1.5-1.5V7.864a.5.5 0 0 0-1 0V14.5a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h6.636a.5.5 0 0 0 .5-.5" /> <path fill-rule="evenodd" d="M16 .5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h3.793L6.146 9.146a.5.5 0 1 0 .708.708L15 1.707V5.5a.5.5 0 0 0 1 0z" /></svg>
</a>
</td>
<td markdown="span">1 year</td>
<td markdown="span">Store and count pageviews</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

<br>

---

## 7. Consent

When you visit my website for the first time, I will show you a pop-up with an explanation about cookies. As soon as you click on “Allow”, you consent to me all placed cookies described in this Cookie Policy. You can disable the use of cookies via your browser, but please note that my website may no longer work properly.

## 8. Enabling/disabling and deleting cookies

You can use your internet browser to automatically or manually delete cookies. You can also specify that certain cookies may not be placed. Another option is to change the settings of your internet browser so that you receive a message each time a cookie is placed. For more information about these options, please refer to the instructions in the Help section of your browser.

Please note that my website may not work properly if all cookies are disabled. If you do delete the cookies in your browser, they will be placed again after your consent when you visit my website again.

## 9. Your rights with respect to personal data

If you have any questions or want to know which personal data I have about you, please contact me. Please refer to the contact details at the bottom of this website's [About](/) page.

## 10. Version History

<table id="table-vh-cookies" data-toggle="table" data-url="{{ '/assets/json/vh_cookies.json' | relative_url }}">
<thead>
<tr>
<th data-field="version">Version</th>
<th data-field="date">Date</th>
<th data-field="author">Author</th>
<th data-field="description">Description</th>
</tr>
</thead>
</table>
Loading

0 comments on commit 75f9b8d

Please sign in to comment.