Portent » european cookie law http://www.eigene-homepage-erstellen.net Internet Marketing: SEO, PPC & Social - Seattle, WA Fri, 11 Sep 2015 18:31:01 +0000 en-US hourly 1 http://wordpress.org/?v=4.3 UK & European Cookie Law Solution (Free Script) http://www.eigene-homepage-erstellen.net/blog/design-dev/web-browser-cookie-law.htm http://www.eigene-homepage-erstellen.net/blog/design-dev/web-browser-cookie-law.htm#comments Wed, 01 Jun 2011 20:59:58 +0000 http://www.eigene-homepage-erstellen.net/?p=1707 A European cookie law that regulates the use of web browser cookies is now in effect in the UK. That cookie law is based on guidelines set by the European Union. In a nutshell, the law states that websites must get a user’s consent before storing cookies on their device (computer, mobile phone, iPad, etc).… Read More

The post UK & European Cookie Law Solution (Free Script) appeared first on Portent.

]]>
A European cookie law that regulates the use of web browser cookies is now in effect in the UK. That cookie law is based on guidelines set by the European Union. In a nutshell, the law states that websites must get a user’s consent before storing cookies on their device (computer, mobile phone, iPad, etc). There’s a lot of confusion around the UK law, and the EU regulation:

  • Does it apply to companies based outside the UK?
  • It allows an exception for cookies that are ‘strictly necessary’. What counts? Shopping cart cookies do. But what about analytics? Login cookies?

Browser Cookie Solution Screenshot
There are no clear answers. The UK did promise to phase in enforcement over time. But if this law succeeds, more cookie regulation is on the horizon. If you own a web site, chances are, you’re placing cookies on visitor’s computers, and you need to comply.

So, we’ve built a simple way to comply with the regulation and its free. Read on to get the code and implement it on your own site.

Note: You use this code at your own risk. We’re not responsible if the UK finds you in violation of their law.

The Solution

Browser Cookie Solution Screenshot
Portent has come up with a simple javascript solution to help you comply with the new European cookie laws. Using the help of a javascript location detection script from GeoBytes.com, the script prompts a user in the EU to consent to the site writing cookies to their device. If the user consents, a cookie is written, set to expire in 90 days, giving the user full access to the site and the cookies it normally writes. If the user does not consent, the script will redirect the user to a static cookie consent information page.

Update (8/7/12): We have learned that about 1 in 50 requests to GeoBytes.com may redirect to an undesired page. This is the result of using the free version of the geolocation service by GeoBytes. I never encountered this in my testing, but I never did any stress testing. To avoid this, you will have to sign up for the GeoBytes service, which seems to be somewhere in the range of $10 (USD) per 10,000 geolocation requests.

Browser Cookie Solution Screenshot

The Script: cookieConsent.js

cookieConsent.js code on Pastebin

Copy the script code above and create a file named cookieConsent.js. Then, make sure you include the javascript file on every page of your site that writes cookies. This will most likely be all of them, especially if you have analytics tracking throughout your site. Put this includes in your header:

<script src="cookieConsent.js" type="text/javascript"></script>

To initiate the script, after page load, put this code snippet just above the end body tag on every page that writes cookies:

<script src="http://gd.geobytes.com/gd?after=-1&variables=GeobytesInternet,sGeobytesCountry,sGeobytesMapReference"></script>
<script language="javascript">cookieConsent(sGeobytesInternet,sGeobytesMapReference);</script>

Static Cookie Consent HTML page: cookie-consent.htm

Browser Cookie Solution Screenshot
This is the page that should be created that gets redirected to when a user does NOT consent to allowing cookies on your site. This page should not write any cookies (analytics, etc.), but provide the user with more information about the cookies used on your site and the choice to accept them again. Here is an example of information for a site that uses cookies for tracking a user’s statistics on the site:

cookie-consent.htm code on Pastebin

You must talk to your attorney before you set up this page. Portent is not a law firm, and we’re not giving legal advice.

More Information

For more information regarding the EU Cookie Laws and suggested updates, see the following:

Demo

For an interactive demo, please visit cookieconsent.eigene-homepage-erstellen.net.

The script will require any user located in Europe or North America (for demo purposes) to consent to cookies being written on the site. If you’re having troubles implementing the script, try viewing the source code of the demo. Also, take a look at the comments below for additional assistance!

The post UK & European Cookie Law Solution (Free Script) appeared first on Portent.

]]>
http://www.eigene-homepage-erstellen.net/blog/design-dev/web-browser-cookie-law.htm/feed 15