Introduction
The European Union's (EU) General Data Protection Regulation (GDPR) 2016/679 is a regulation in EU law on data protection and privacy for all individuals within the European Union and the European Economic Area. It also addresses the export of personal data outside the EU and EEA. The GDPR aims primarily to give control to citizens and residents over their personal data and to simplify the regulatory environment for international business by unifying the regulation within the EU.
Can you break the law down simply?
Individuals have the right to know what information about them is being collected, how their information is being used, notification when this information is breached or shared without consent, and the right for this information to be removed ("the right to be forgotten") when there is no longer a business case need.
Why does Auburn University care about an EU law?
Auburn University recruits internationally for students, faculty, employees, and research interests. Auburn reaches globally through distant education and study abroad programs as well as communicates with alumni all over the world.
What's does this mean for you?
Please read Auburn University's updated Privacy Statement for more information.
GDPR development notes
These code examples show how the Auburn University homepage has implemented GDPR cookie acceptance compliance. You may use this code as well for your websites.
STYLES
#gdpr{
background-color:#03244d;
bottom:0;
color:#fff;
opacity:0.97;
position:fixed;
text-align:center;
width:100%;
z-index:1050;
}
#gdpr div{
display:inline-block;
margin:5px auto;
max-width:700px;
padding:15px;
}
#gdpr p{
line-height:1.4;
padding:5px 0;
}
#gdpr a{
color:#fff;
font-weight:bold;
text-decoration-style: dashed;
}
#gdpr button{
border:0;
}
#gdpr button.close{
color:#fff;
float:right;
margin:-11px -5px 0 0;
opacity:.8;
}
HTML
Note: This code needs to go right after the opening <body>
.
<div id="gdpr" class="content_row" style="display:none;">
<div class="alert alert-info" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">x</span></button>
<p class="h4">Cookie Acceptance Needed</p>
<p class="h5">This website would like to use cookies to collect information to improve your browsing experience. Please review our <a href="http://www.auburn.edu/privacy" style="font-weight: bold;">Privacy Statement</a> for more information. Do you accept?</p>
<p><button class="btn btn-default btn-sm" id="cookieAccept">accept</button> <button class="btn btn-primary btn-sm" id="cookieDeny">deny</button></p>
</div>
</div>
SCRIPTS
// DOCUMENT ONREADY SCRIPT
$(function(){
// LISTENER TO ACCEPT COOKIES
$('#cookieAccept').on('click',function(){
var d = new Date();
// set expiration date for one year
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000));
var expires = "expires="+d.toUTCString();
// set the cookie
document.cookie = "auburnGATC=accept;" + expires + "; domain=.auburn.edu; path=/";
// make the modal fade away
$("#gdpr").fadeOut();
// trigger any JavaScript functions now allowed
GATC();
});
// LISTENER TO DENY COOKIES
$('#cookieDeny').on('click',function(){
var d = new Date();
// set expiration date for one year
d.setTime(d.getTime() + (365 * 24 * 60 * 60 * 1000));
var expires = "expires="+d.toUTCString();
// set the cookie
document.cookie = "auburnGATC=deny;" + expires + "; domain=.auburn.edu; path=/";
// make the modal fade away
$("#gdpr").fadeOut();
});
// CHECK COOKIE STATUS
var cookieStatus = getCookie("auburnGATC");
if (cookieStatus === "accept") {
// cookies have been accepted
// trigger any JavaScript functions allowed
GATC();
} else if (cookieStatus === "deny") {
// cookies have been denied, do nothing else
} else {
// cookie hasn’t been set, show the modal
$("#gdpr").fadeIn();
}
});
// GET THE COOKIE
function getCookie(cname) {
var name = cname + "=";
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);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
// FUNCTION FOR GOOGLE ANALYTICS TRACKING COOKIE
function GATC(){
(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','//www.google-analytics.com/analytics.js','ga');
// the university-wide tracking code
ga('create', 'UA-2228003-3', 'auto'); // AU Tracker
ga('send', 'pageview');
// department/organization-level tracking code
// ga('create', 'UA-XXXXXX-X', 'auto', 'myTracker'); // Your Tracker Code
// ga('myTracker.send', 'pageview');
};