Skip to content

Commit

Permalink
Merge pull request #475 from teiling88/feature/1038-google-analytics
Browse files Browse the repository at this point in the history
Feature/1038 google analytics
  • Loading branch information
teiling88 committed May 16, 2017
2 parents e362bc1 + 6df5b72 commit 306c76f
Show file tree
Hide file tree
Showing 7 changed files with 310 additions and 180 deletions.
2 changes: 2 additions & 0 deletions htdocs/config2/settings-dev.inc.php
Expand Up @@ -104,6 +104,8 @@
$opt['page']['showsocialmedia'] = true;
$opt['page']['headoverlay'] = 'oc_head_alpha3';

$opt['tracking']['googleAnalytics'] = 'UA-59334952-4';

$opt['logic']['pictures']['dummy']['replacepic'] = $dev_basepath . $dev_codepath . 'htdocs/images/no_image_license.png';
$opt['logic']['license']['disclaimer'] = true;
$opt['logic']['admin']['listingadmin_notification'] = 'root';
Expand Down
35 changes: 35 additions & 0 deletions htdocs/lang/de/ocstyle/main.tpl.php
Expand Up @@ -344,5 +344,40 @@ function flashbutton(bname)
</div> <!-- page-container-1 -->

</div> <!-- overall -->
<?php if($opt['tracking']['googleAnalytics']) { ?>
<script type="text/javascript">
// Set to the same value as the web property used on the site
var gaProperty = '<?= $opt['tracking']['googleAnalytics']; ?>';

// Disable tracking if the opt-out cookie exists.
var disableStr = 'ga-disable-' + gaProperty;
if (document.cookie.indexOf(disableStr + '=true') > -1) {
window[disableStr] = true;
}

// Opt-out function
function gaOptout() {
document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
window[disableStr] = true;
if (document.cookie.indexOf(disableStr + '=true') > -1) {
alert('Google Analytics is now deactivated!');
}
}
</script>
<?php if (!$_SERVER['HTTP_DNT']){ ?>
<script type="text/javascript">
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

ga('create', gaProperty, 'auto');
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>
<?php
}
}
?>
</body>
</html>
2 changes: 2 additions & 0 deletions htdocs/lib/settings-dev.inc.php
Expand Up @@ -114,6 +114,8 @@

$opt['translate']['debug'] = false;

$opt['tracking']['googleAnalytics'] = 'UA-59334952-4';

/* maximum number of failed logins per hour before that IP address is blocked
* (used to prevent brute-force-attacks)
*/
Expand Down
3 changes: 1 addition & 2 deletions htdocs/lib2/OcSmarty.class.php
Expand Up @@ -211,6 +211,7 @@ public function display($dummy1 = null, $dummy2 = null, $dummy3 = null)
$optn['format'] = $opt['locale'][$opt['template']['locale']]['format'];
$optn['mail'] = $opt['mail'];
$optn['lib'] = $opt['lib'];
$optn['tracking'] = $opt['tracking'];
$optn['geokrety'] = $opt['geokrety'];
$optn['template']['usercountrieslist'] = labels::getLabels('usercountrieslist');
$optn['help']['oconly'] = helppagelink('oconly', 'OConly');
Expand Down Expand Up @@ -257,8 +258,6 @@ public function display($dummy1 = null, $dummy2 = null, $dummy3 = null)
// build address for switching locales and countries
$base_pageadr = $_SERVER['REQUEST_URI'];



// workaround for http://redmine.opencaching.de/issues/703
$strange_things_pos = strpos($base_pageadr, '.php/');
if ($strange_things_pos) {
Expand Down
266 changes: 147 additions & 119 deletions htdocs/templates2/ocstyle/articles/DE/dsb.tpl

Large diffs are not rendered by default.

142 changes: 84 additions & 58 deletions htdocs/templates2/ocstyle/articles/EN/dsb.tpl
@@ -1,90 +1,116 @@
{***************************************************************************
* You can find the license in the docs directory
***************************************************************************}
<div class="content2-pagetitle">
<img src="resource2/{$opt.template.style}/images/profile/32x32-security.png" style="margin-right: 10px;" width="32" height="32" alt="" />Privacy statement
</div>
<div class="content-txtbox-noshade" style="padding-right: 25px;">
<div class="content2-pagetitle">
<img src="resource2/{$opt.template.style}/images/profile/32x32-security.png" style="margin-right: 10px;" width="32" height="32" alt="" />Privacy statement
</div>
<div class="content-txtbox-noshade" style="padding-right: 25px;">

<p><i>This is a tentative English translation of the German privacy statement for this website, which is available by selecting German language and choosing "Datenschutzbelehrung" at the very bottom of the page. When in doubt, or the translation is incomplete or contradicting, the German version is always the valid reference for legal issues. This explanation refers to all Geocaching listing sites operated by Opencaching Deutschland: www.opencaching.de, www.opencaching.it, www.opencachingspain.es and www.opencaching.fr.</i></p>
<p><i>This is a tentative English translation of the German privacy statement for this website, which is available by selecting German language and choosing "Datenschutzbelehrung" at the very bottom of the page. When in doubt, or the translation is incomplete or contradicting, the German version is always the valid reference for legal issues. This explanation refers to all Geocaching listing sites operated by Opencaching Deutschland: www.opencaching.de, www.opencaching.it, www.opencachingspain.es and www.opencaching.fr.</i>
</p>

<p>We respect your right of informational self-determination. According to German TMG, title 13, and BDSG, title 33, part 1 we explain here which data will be stored by us for which purpose, and how you can inspect the data or have it deleted.</p>
<p>We respect your right of informational self-determination. According to German TMG, title 13, and BDSG, title 33, part 1 we explain here which data will be stored by us for which purpose, and how you can inspect the data or have it deleted.</p>

<h2>User account</h2>
<h2>User account</h2>

<p>Some services of the Opencaching.de website require a user registration. When registering, you <strong>must</strong> enter</b></p>
<p>Some services of the Opencaching.de website require a user registration. When registering, you <strong>must</strong> enter</b></p>

<ul class="narrowlist">
<li>a user name of your choice,</li>
<li>a valid email address, and</li>
<li>a password of your choice.</li>
</ul>
<ul class="narrowlist">
<li>a user name of your choice,</li>
<li>a valid email address, and</li>
<li>a password of your choice.</li>
</ul>

<p>This data will be stored in your user profile, together with the date and time of your registration.</p>
<p>This data will be stored in your user profile, together with the date and time of your registration.</p>

<p>Besides of this, you may enter the following <strong>optional</strong> data in your user profile:</p>
<p>Besides of this, you may enter the following <strong>optional</strong> data in your user profile:</p>

<ul class="narrowlist">
<li>first and last name</li>
<li>home coordinates</li>
<li>home country</li>
<li>home town</li>
<li>age</li>
</ul>
<ul class="narrowlist">
<li>first and last name</li>
<li>home coordinates</li>
<li>home country</li>
<li>home town</li>
<li>age</li>
</ul>

<p>We will also record the date and time of your account creation and of your last visit at our website.</p>
<p>We will also record the date and time of your account creation and of your last visit at our website.</p>

<p>We will never pass on your email address and/or name to third parties without your explicit request.</p>
<p>We will never pass on your email address and/or name to third parties without your explicit request.</p>

<p>Your user name, home country, coordinates, all data marked as "visible" on the "details" page of your user profile and your registration date can be viewed by any visitors of the Opencaching.de website and may be requested by and transferred to third parties and other websites, e.g. for creating geocaching statistics. For registered Opencaching.de users, your home location is also visible. However, we reserve the right to deny access to this data by anyone whose intentions may be harmful for you or Opencaching.de. If you do not agree with transfering these data to third parties, you should either enter no data (not applicable to user name and date/time) or e.g. enter inaccurate coordinates.</p>
<p>Your user name, home country, coordinates, all data marked as "visible" on the "details" page of your user profile and your registration date can be viewed by any visitors of the Opencaching.de website and may be requested by and transferred to third parties and other websites, e.g. for creating geocaching statistics. For registered Opencaching.de users, your home location is also visible. However, we reserve the right to deny access to this data by anyone whose intentions may be harmful for you or Opencaching.de. If you do not agree with transfering these data to third parties, you should either enter no data (not applicable to user name and date/time) or e.g. enter inaccurate coordinates.</p>

<p>Your first and last name (if entered) and email address are visible for members of Opencaching.de support team and for system administrators. The password is stored encoded in a way which makes it unreadable and not reconstructible.</p>
<p>Your first and last name (if entered) and email address are visible for members of Opencaching.de support team and for system administrators. The password is stored encoded in a way which makes it unreadable and not reconstructible.</p>

<p>Cache listings, log entries and published pictures are no private data and may be passed on to third parties.</p>
<p>Cache listings, log entries and published pictures are no private data and may be passed on to third parties.</p>

<h2>Cookies</h2>
<h2>Cookies</h2>

<p>Opencaching.de stores several <a href="http://de.wikipedia.org/wiki/HTTP-Cookie" target="_blank">cookies</a> in your web browser. They contain information on the website state as chosen
by you, e.g. login status, language and editor preferences. This way, the Opencaching site
will behave the same after you leave it and come back.</p>
<p>Opencaching.de stores several <a href="http://de.wikipedia.org/wiki/HTTP-Cookie" target="_blank">cookies</a> in your web browser. They contain information on the website state as chosen
by you, e.g. login status, language and editor preferences. This way, the Opencaching site
will behave the same after you leave it and come back.</p>

<p>For detailed information, see the developers' <a href="https://github.com/OpencachingDeutschland/oc-server3/tree/stable/doc/cookies.txt">cookie documentation</a>.</p>
<p>For detailed information, see the developers' <a href="https://github.com/OpencachingDeutschland/oc-server3/tree/stable/doc/cookies.txt">cookie documentation</a>.</p>

<h2>Webserver protocols</h2>
<h2>Google Analytics</h2>

<p>Like any webserver, Opencaching.de keeps a protocol of all requested pages. For each request,
it contains the user's IP address, date and time, address (URL) of the requested page,
the transferred data amount and the identification of the web browser used. It does <em>not</em>
contain the user name or any other information from the Opencaching.de user account.</p>
<p>This website uses Google Analytics, a web analytics service provided by Google, Inc. (“Google”). Google Analytics uses “cookies”, which are text
files placed on your computer, to help the website analyze how users use the site. The information generated by the cookie about your use of the
website (including your IP address) will be transmitted to and stored by Google on servers in the United States. In case of activation of the
IP anonymization, Google will truncate/anonymize the last octet of the IP address for Member States of the European Union as well as for other parties
to the Agreement on the European Economic Area. Only in exceptional cases, the full IP address is sent to and shortened by Google servers in the USA.
</p>
<p>On behalf of the website provider Google will use this information for the purpose of evaluating your use of the website, compiling reports on website
activity for website operators and providing other services relating to website activity and internet usage to the website provider. Google will not
associate your IP address with any other data held by Google. You may refuse the use of cookies by selecting the appropriate settings on your browser.
However, please note that if you do this, you may not be able to use the full functionality of this website. Furthermore you can prevent Google’s collection
and use of data (cookies and IP address) by downloading and installing the browser plug-in available under
<a href="https://tools.google.com/dlpage/gaoptout?hl=en-GB" target="_blank">https://tools.google.com/dlpage/gaoptout?hl=en-GB</a>.
</p>
<p>You can refuse the use of Google Analytics by clicking on the following link. An opt-out cookie will be set on the computer, which prevents the future collection
of your data when visiting this website: <a href="javascript:gaOptout();">Disable Google Analytics</a>
</p>
<p>
Further information concerning the terms and conditions of use and data privacy can be found at
<a href="http://www.google.com/analytics/terms/gb.html" target="_blank">http://www.google.com/analytics/terms/gb.html</a> or at
<a href="https://www.google.de/intl/en_uk/policies/" target="_blank">https://www.google.de/intl/en_uk/policies/</a> . Please note that on this website, Google Analytics code
is supplemented by “anonymizeIp” to ensure an anonymized collection of IP addresses (so called IP-masking).
</p>

<p>The protocol is kept for some weeks back; older entries are automatically deleted.
It is accessible only for server administratores of Opencaching.de and will be used solely
for statistical purposes and for diagnosis of technical problems.</p>
<h2>Webserver protocols</h2>

<p>Also, there is a protocol of emails sent by the Opencaching software, e.g. messages
about new caches and logs. It contains data for the last 30 days, is accessible only
for system admins and will only be used for diagnoses of email delivery problems.</p>
<p>Like any webserver, Opencaching.de keeps a protocol of all requested pages. For each request,
it contains the user's IP address, date and time, address (URL) of the requested page,
the transferred data amount and the identification of the web browser used. It does <em>not</em>
contain the user name or any other information from the Opencaching.de user account.</p>

<h2>Inspecting your stored data</h2>
<p>The protocol is kept for some weeks back; older entries are automatically deleted.
It is accessible only for server administratores of Opencaching.de and will be used solely
for statistical purposes and for diagnosis of technical problems.</p>

<p>After logging in, you can view and change your data at the "My Profile" page.
You can also see your registration date there.</p>
<p>You can inspect the stored cookies within your web browser.</p>
<p>Also, there is a protocol of emails sent by the Opencaching software, e.g. messages
about new caches and logs. It contains data for the last 30 days, is accessible only
for system admins and will only be used for diagnoses of email delivery problems.</p>

<h2>Deleting your stored data</h2>
<h2>Inspecting your stored data</h2>

<p>You can always delete all optional data from your user profile, and you can change
the mandantory user name, email address and password as you like (as long as the email address stays valid).</p>
<p>After logging in, you can view and change your data at the "My Profile" page.
You can also see your registration date there.</p>
<p>You can inspect the stored cookies within your web browser.</p>

<p>Accounts of users who did find or log caches cannot be deleted. Hovever, they can be disabled. Disabling includes deletion of all data, including the email address, from the user profile. The user name, cache listings and logs will be retained and stay visible, but the listings will be locked and cannot be logged from thereon. If you desire to disable your Opencaching.de account, please send an email to <a href="mailto:{$opt.mail.contact}">{$opt.mail.contact}</a> and using the email address specified in your profile. We then will disable your account.</p>
<h2>Deleting your stored data</h2>

<p>To allow for fixing operating errors, the personal data will be kept for two weeks after user deactivation, before they are finally deleted.</p>
<p>You can always delete all optional data from your user profile, and you can change
the mandantory user name, email address and password as you like (as long as the email address stays valid).</p>

<p>A user deactivation cannot be reversed. If you would like to use Opencaching.de thereafter,
you will have to register again with a new user name and eventually re-list your caches.</p>
<p>Accounts of users who did find or log caches cannot be deleted. Hovever, they can be disabled. Disabling includes deletion of all data, including the email address, from the user profile. The user name, cache listings and logs will be retained and stay visible, but the listings will be locked and cannot be logged from thereon. If you desire to disable your Opencaching.de account, please send an email to <a href="mailto:{$opt.mail.contact}">{$opt.mail.contact}</a> and using the email address specified in your profile. We then will disable your account.</p>

<p>You may delete the cookies in your web browser.</p>
<p>To allow for fixing operating errors, the personal data will be kept for two weeks after user deactivation, before they are finally deleted.</p>

<p>For questions or when in doubt, please contact us at <a href="mailto:{$opt.mail.contact}">{$opt.mail.contact}</a>!</p>
</div>
<br />
<p>A user deactivation cannot be reversed. If you would like to use Opencaching.de thereafter,
you will have to register again with a new user name and eventually re-list your caches.</p>

<p>You may delete the cookies in your web browser.</p>

<p>For questions or when in doubt, please contact us at <a href="mailto:{$opt.mail.contact}">{$opt.mail.contact}</a>!</p>
</div>
<br />

0 comments on commit 306c76f

Please sign in to comment.