-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #825 from BioSchemas/analytics
Add Google analytics and privacy page
- Loading branch information
Showing
6 changed files
with
159 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<style> | ||
#cookie-notice {padding: 0.5rem 1rem; display: none; text-align: center; position: fixed; bottom: 0; width: calc(100% - 2rem); background: #222; color: rgba(255,255,255,0.8);} | ||
#cookie-notice a {display: inline-block; cursor: pointer; margin-left: 0.5rem;} | ||
@media (max-width: 767px) { | ||
#cookie-notice span {display: block; padding-top: 3px; margin-bottom: 1rem;} | ||
#cookie-notice a {position: relative; bottom: 4px;} | ||
} | ||
</style> | ||
<div class="container w-100" id="cookie-notice"> | ||
<span>We would like to use third party cookies and scripts to improve the functionality of this website.</span> | ||
<a id="cookie-notice-accept" class="btn btn-primary btn-sm">Approve</a> | ||
<a id="cookie-notice-deny" class="btn btn-primary btn-sm">Deny</a> | ||
<a href="/about/privacy.html" class="btn btn-primary btn-sm">More info</a> | ||
</div> | ||
<script> | ||
function createCookie(name,value,days) { | ||
var expires = ""; | ||
if (days) { | ||
var date = new Date(); | ||
date.setTime(date.getTime() + (days*24*60*60*1000)); | ||
expires = "; expires=" + date.toUTCString(); | ||
} | ||
document.cookie = name + "=" + value + expires + "; path=/"; | ||
} | ||
function readCookie(name) { | ||
var nameEQ = name + "="; | ||
var ca = document.cookie.split(';'); | ||
for(var i=0;i < ca.length;i++) { | ||
var c = ca[i]; | ||
while (c.charAt(0)==' ') c = c.substring(1,c.length); | ||
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length); | ||
} | ||
return null; | ||
} | ||
function eraseCookie(name) { | ||
createCookie(name,"",-1); | ||
} | ||
|
||
if(readCookie('cookie-notice-option')=='true') { | ||
{% if jekyll.environment == "production" and site.google_analytics %} | ||
{% include ga.js %} | ||
{% endif %} | ||
} else if (readCookie('cookie-notice-option')!='false'){ | ||
document.getElementById('cookie-notice').style.display = 'block'; | ||
} | ||
|
||
document.getElementById('cookie-notice-accept').addEventListener("click",function() { | ||
createCookie('cookie-notice-option','true',31); | ||
document.getElementById('cookie-notice').style.display = 'none'; | ||
location.reload(); | ||
}); | ||
|
||
document.getElementById('cookie-notice-deny').addEventListener("click",function() { | ||
createCookie('cookie-notice-option','false',31); | ||
document.getElementById('cookie-notice').style.display = 'none'; | ||
location.reload(); | ||
}); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
function loadScriptAsync(scriptSrc, callback) { | ||
if (typeof callback !== 'function') { | ||
throw new Error('Not a valid callback for async script load'); | ||
} | ||
var script = document.createElement('script'); | ||
script.onload = callback; | ||
script.src = scriptSrc; | ||
document.head.appendChild(script); | ||
} | ||
|
||
loadScriptAsync('https://www.googletagmanager.com/gtag/js?id=G-G3BQK7PF1V', function () { | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag() { dataLayer.push(arguments); } | ||
gtag('js', new Date()); | ||
gtag('config', 'G-G3BQK7PF1V', { 'anonymize_ip': true }); | ||
console.log('Google Analytics is active'); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,5 +11,6 @@ | |
</main> | ||
</div> | ||
{% include footer.html %} | ||
{% include cookie-consent.html %} | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
--- | ||
layout: default | ||
title: Privacy | ||
--- | ||
<h1>Privacy Policy</h1> | ||
<p>Last updated: September 16, 2024</p> | ||
<p>This Privacy Policy explains what personal data is collected by Bioschemas website.</p> | ||
|
||
<h2>What data we collect</h2> | ||
<p> | ||
We collect data about your activity on the site, such as: | ||
</p> | ||
<ul> | ||
<li>which pages you have visited</li> | ||
<li>how long you spent on each page</li> | ||
<li>which browsers and devices you have used to view the site</li> | ||
<li>which country you view the site from.</li> | ||
</ul> | ||
<p> | ||
The information is collected anonymously and aggregated. We cannot identify you from the information gathered, | ||
or track your web browsing outside of this site. | ||
</p> | ||
|
||
<h2>How we collect the data</h2> | ||
<p> | ||
We use Google Analytics to collect this data. When you visit this site, Google Analytics puts a small file called | ||
a cookie in your browser. Cookies are widely used to store preferences and to enable shopping carts and log-in | ||
areas on websites. | ||
</p> | ||
|
||
<h2>Why we collect the data</h2> | ||
<p> | ||
We collect the data so that we can then generate reports about the site for our funders. | ||
We also collect the date to help us improve the site, and ensure we design the site for the browsers and devices | ||
that most people are using. | ||
</p> | ||
|
||
<h2>Who has access to the data</h2> | ||
<p> | ||
The data collected from your visit to the site is sent to Google but aggregated and anonymised. | ||
We do not have access to personally identifiable information, but Google records and stores your IP address | ||
in order to generate the site statistics. | ||
</p> | ||
|
||
<p> | ||
See <a href="https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage" target="_blank"> | ||
Google Analytics cookies information</a> and | ||
<a href="https://support.google.com/analytics/answer/6004245?hl=en" target="_blank">Google's Safeguarding your data | ||
article</a>. | ||
</p> | ||
|
||
<h2>If you have concerns about your data</h2> | ||
<p> | ||
We ask for your permission to set the cookie when you visit the site, but if you change your mind you can: | ||
</p> | ||
<ul> | ||
<li><strong>Remove the cookie manually.</strong> See the | ||
<a href="https://us.norton.com/internetsecurity-privacy-how-to-clear-cookies.html" target="_blank"> | ||
Norton Security website</a> for detailed instructions. | ||
</li> | ||
<li><strong>Use a browser extension to stop the cookie</strong>, such as | ||
<a href="https://tools.google.com/dlpage/gaoptout" target="_blank">Google's Opt-out Browser Add-on</a>. | ||
</li> | ||
</ul> | ||
<p> | ||
Please contact <a href="mailto:steering@bioschemas.org">steering@bioschemas.org</a> if you have any queries | ||
concerning the data we may have. | ||
</p> | ||
|
||
<h2>Your GitHub information</h2> | ||
<p> | ||
If you are a contributor to the site then you will be automatically listed as a contributor, | ||
with a link to your GitHub pages. If you would like to be removed from the contributor list then please contact | ||
<a href="mailto:steering@bioschemas.org">steering@bioschemas.org</a>. | ||
</p> | ||
<p> | ||
You may also want to see the | ||
<a href="https://docs.github.com/en/github/site-policy/github-privacy-statement" target="_blank"> | ||
GitHub Privacy Statement</a>. | ||
</p> |