Loading


Advertisement:

Author Topic: [PLUGIN] European Cookie law plugin (in development)  (Read 6190 times)

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4390
[PLUGIN] European Cookie law plugin (in development)
« on: October 26, 2013, 11:40:10 pm »
Hi everyone,

I've been working on this plugin for quite a time now. What does exactly do? It makes your website compatible with the European Cookie law, it's based in the JQuery plugin CookieCuttr.


Update to 0.0.2
Added a preview in the admin configuration area



IMPORTANT - WARNING
The European Cookie law is "open" to interpretation on what it's considered "consent" or not. This plugin (if configured) will create Google Analytics cookies until they are declined (to get better stats), if you feel that's wrong and Google Analytics don't have to be created until the cookies are accepted change the following code in the index.php file.

From
Code: [Select]
            if (jQuery.cookie('cc_cookie_decline') == "cc_cookie_decline") {
            } else {

To
Code: [Select]
            if (jQuery.cookie('cc_cookie_accept') == "cc_cookie_accept") {
            // remove the } else { too

Features
* Easy to use
* Messages could be modified
* Easy integration with Google Analytics (if you use GA with this plugin, disable any other plugin you have of GA)


Future development and ideas
I plan to add some more configuration options based on the feedback (if you give some)

IMPORTANT NOTE 2
As far as I know, the whole European Cookie law is about third party cookies (facebook, google, twitter,...) anything you include in your site to track the visit or depends on a external service. Osclass itself only uses cookies to store the required session/login data and you don't have to warn the user about them. This plugin DO NOT STOP the use of other cookies such as facebook or twitter, it just warn the user about them and consider that if you keep browsing the site you consent them (what most sites do). It's very hard to adapt it to every country's own law, and every website out there.

IMPORTANT NOTE 3
This plugin will only works with Osclass 3.2 and superior


DISCLAIMER
I'm not responsible if something goes wrong. I made this plugin on my personal time (my time dedicated to Osclass has not been affected) for my personal joy and thought I should share it. Please consider donating to Osclass (click on the orange button) or spare some bitcoins to this address : 1CoNejopbQsa3uCkjMC8VcE3RndajCcXHW

The plugin is attached to this post and the source could be found at GitHub (pull-requests are welcomed)
« Last Edit: October 27, 2013, 08:06:19 pm by _CONEJO »

Aficionado

  • Hero Member
  • *****
  • Posts: 4027
  • Good things come to those who wait
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #1 on: October 27, 2013, 12:48:42 am »
If i understand correctly this is also a GA plugin ?

If so, where is the script loaded, in the header or footer ?

Thanks !


_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4390
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #2 on: October 27, 2013, 01:03:16 am »
If an analytics ID is provided, the plugin will add the following code at the header :

Code: [Select]
               var _gaq = _gaq || [];
                _gaq.push(['_setAccount', '<?php echo osc_get_preference('analytics_id''cookie'); ?>']);
                _gaq.push(['_trackPageview']);

                (function() {
                    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                    var s = document. getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
 

Aficionado

  • Hero Member
  • *****
  • Posts: 4027
  • Good things come to those who wait
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #3 on: October 27, 2013, 05:29:24 am »
Ok, some questions and some comments:

1. Using the Analytics code, why the Cookies information link is an external website ? Why not a modal ?

2. Not using the Analytics code, the href="%s"  doesn't "do" anything. Am i doing something wrong ?

I see no problems, works well ...

 8)

Aficionado

  • Hero Member
  • *****
  • Posts: 4027
  • Good things come to those who wait
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #4 on: October 31, 2013, 10:02:41 pm »
Since installed that plugin and removed analytics plugin, i see no stats in Google Analytics.


_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4390
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #5 on: October 31, 2013, 10:04:22 pm »
Did you configure your analytics id in the admin panel?
Could I see the HTML of your website to check if the JS is being created?

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4390
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #6 on: October 31, 2013, 10:29:02 pm »
Hi,

I checked the plugin in my local and it seems to be running fine. Too check it, for example, edit the index.php of the plugin (oc-content/plugins/cookie/index.php)

look for

Code: [Select]
(function() {
                    console.log("GA LOADED");
                    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                    var s = document. getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                })();
And add an alert, something like this

Code: [Select]
(function() {
                    alert("GA LOADED");
                    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
                    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                    var s = document. getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
                })();

An alert should appear on your website. besides that, if you check with Chrome's console or firebug, you will see that the file ga.js is being loaded (network tab). Also, the JS code is the same Google provide (checked). If you inspect the live HTML (In chrome, just right click and choose inspect element) you will see also the script tag of google analytics in works


You have another JS error, this file could not be loaded :  http://pagead2.googlesyndication.com/pagead/show_ads.js   but it's related to adsense (I think) and not to this plugin. Maybe this is causing some kind of problem?

s51

  • Sr. Member
  • ****
  • Posts: 309
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #7 on: November 01, 2013, 02:43:50 pm »

.
Hi friend _CONEJO ...

1
.)

>>It makes your website compatible with the European Cookie law
THANKS 8)
Very good, = because the fine tariffs are high if you do not have it. :o
- -

2
.)

>>Messages could be modified
Bob-bob-bob,,, - but only in PHP as hardcode, and buttons text are hard to do !
So in short = PLEASE make Po/Mo lang files
- -

3
.)

As is now, it,s once per session depending, - but it,s so damed annoying,
that users get the warning in every visit, - also even they have accepted.
When user accept = Then please set a accept cookie, - e.g. with 12 month expiring.
- -

5
.)

>>I plan to add some more configuration options based on the feedback (if you give some)
_CONEJO ..
* Some place (cant remember where) you you wrote something about different texture law legislation
if you are smart, then make a copy of the function from LOPD plugin, where user can write own txt
* And move the warning to the bottom of page, - and make it user adjustable transparent
- -

Best Regards
.:/ s51

.

filipe

  • Jr. Member
  • **
  • Posts: 50
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #8 on: December 01, 2013, 10:13:54 pm »
Hello
Where can i change this to another thing.... We use cookies on this website
THKS

aide2001

  • Guest
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #9 on: February 10, 2014, 01:04:02 pm »
I have a cookie policy put on my site,  but its not a plugin, I've just done it manually to my original theme. As all my plugins never seem to work!
If you want any help on this let me know, you have to change some core files though, and upload one script file, if you don't know how to do this, don't ask me for help, as you can mess your site up.
« Last Edit: March 18, 2014, 10:08:32 pm by aide2001 »

Aficionado

  • Hero Member
  • *****
  • Posts: 4027
  • Good things come to those who wait
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #10 on: March 27, 2014, 11:01:20 pm »
Daniel:

FYI

http://blog.silktide.com/2013/01/the-stupid-cookie-law-is-dead-at-last/

Not sure what exactly means and if the article is legit. If it is, we all need to tell people we are using cookies.


dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 1536
  • osclass.work
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #11 on: March 28, 2014, 12:30:16 am »
:)

The article reflects my exact opinion on this farse. Simple Cookie Policy page is enough instead of aggressive and borring notifications. I am completely annoyed by websites who constantly notify me about cookies.

_CONEJO

  • Administrator
  • Hero Member
  • *****
  • Posts: 4390
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #12 on: March 28, 2014, 12:44:53 am »
Daniel:

FYI

http://blog.silktide.com/2013/01/the-stupid-cookie-law-is-dead-at-last/

Not sure what exactly means and if the article is legit. If it is, we all need to tell people we are using cookies.


Hi

This is in the line of what the European Union said a few months ago (and the plugin implements, since it's configurable). See IMPORTANT NOTE (on the original post or below). Also, please remember that the European Union is made by several countries, and each country is free (for now) to make their own laws and regulations. The European Union is just a "guideline" or a very basic restriction/law/norms/... each country could decide to restrict even more or modify a little those laws.

Quote
IMPORTANT NOTE
The European Cookie law is "open" to interpretation on what it's considered "consent" or not.

So, here, the EU leave the door open to several  interpretations. Most countries didn't do anything about it, some countries (cant remember exactly which one) asked for explicit consent, others like UK just did, asked for implicit consent.

Explicit consent: Users needs to accept the cookies before a cookie is created via a process (usually just click a button).

Implicit/Implied/Indirect consent: Users accept cookies by indirect actions (usually keep browsing on their website). Note: cookies should be created after the user keep browsing!

Opt-out consent (what in my opinion most countries applied and just the UK has regulated): This is what most people do in real life, not doing this implies you're missing first visit of your users. Users "accept" cookies, but have the right to opt-out (stop being tracked/using cookies).


Differences between implicit and opt-out: opt-out consent will create the cookie without the user's consent, ie. user load your page -> create cookie -> keep browsing
implicit consent will create the cookie AFTER the user keep browsing your page : user load your page -> keep browsing -> create cookie
The difference is very small, but means that implicit consent will miss the first page load of your users (which is a lot of data!)


Worst thing, is that is the user DO NOT WANT to be tracked/use cookies... there's no way to save his preference, and next time he will be prompted again and again and again...


In my opinion these kind of laws are stupid because 99.999% of the websites have this popup/topbar/footer/whatever, so maybe, include an icon in a browser but be way less invasive (but also, that's not a browser responsibility)


davidsanchezdegroeve

  • Newbie
  • *
  • Posts: 12
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #13 on: July 18, 2014, 07:35:43 pm »
Hello everybody,

Is there any way to change the cookies bar position?

I mean, where can I change the code to put the bar down on the webpage.

Many thanks in advance,

David Sánchez

garxina

  • Newbie
  • *
  • Posts: 16
Re: [PLUGIN] European Cookie law plugin (in development)
« Reply #14 on: October 12, 2014, 11:17:40 am »
Google indexes the cookies law text. Theres is some kind to hide this text from google index. Cause is the first text about my site that's in google.

Thanks