Privacy notification alpha87  2014-05-29 09:16
Status: Closed
 
Hi all,

just a quick question: due to EU privacy laws, websites hosted in the EU community should notify users if they set cookies/track activity, even if it's just Google Analytics or cookies needed by the system to allow login.

I've already successfully used http://cookiecuttr.com/ to enable such notifications in other websites, but I'm frankly new to java development, and I was wondering if somebody can help me in make this work.

In theory, it's a two-step work:
- add these additional external .js scripts & css files to all web pages and somewhere on the server:
<script src="//ajax.googleapis.com/ajax/ libs/jquery/1.7.1/jquery.js"></script>
<script>window.jQuery || document.write("<script src='assets/js/libs/jquery-1.7.1.min.js'>\x3C/script>")</script>
<script src="jquery.cookie.js"></script>
<script src="jquery.cookiecuttr.js"></script>
<link rel="stylesheet" href="cookiecuttr.css">

- add the following javascript snip to all pages:
if (jQuery.cookie('cc_cookie_accept') == "cc_cookie_accept") {
// insert the code you do not want to run UNTIL cookies are accepted here
}


Thank you!
 
 
Matthew Bellew responded:  2014-05-29 12:33
1) the easiest way to add something to every page is to use a customization feature we added for analytics. The first link on the admin console is "analytics settings". On that page you'll find a big text box that let's you put pretty much whatever you want into the <head> of every page. Since you can put script here you can also add HTML to the page if that is required.

2) If you want to go route of editing the template, the file you're looking for is "api/src/org/labkey/api/view/CommonTemplate.jsp".

I would really try to exhaust the first option, before going down the second path. I think you'll find it easier if you can simply use offical builds, rather than having to build your own.

If you come up with a solution that can be configured by via an admin page that is generally useful, you can consider submitting a patch for the main product as well.
 
alpha87 responded:  2014-05-30 03:02
Matthew,

thank you for your help.

Just successfully deployed it, using the "Analytics" feature to add the css/scripts and adding the .js files in extraWebapp!