Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Join Date
    Mar 2011
    Posts
    19
    Plugin Contributions
    0

    help question Where to add code?

    Due to the new EU cookie law, I've been looking for a way to keep my site legal, since I use Google Analytics. I've found something called Cookie Control that will let people opt-in if they want cookies. The instructions are to upload a .js script to the site then to add some given code within the <body> tag of a page.

    I've uploaded the script to my /includes folder but I'm unsure of where will be the right place to put the code so it will take place on every page on my site. I thought the most likely place would be includes/templates/MYTEMPLATE/common/tpl_main_page.php but adding the code there changed nothing. The code I've been given is:

    <script src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script>
    <script src="/includes/cookieControl-4.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">//<![CDATA[
    cookieControl({
    introText:'<p>This site uses some unobtrusive cookies to store information on your computer, as well as some essential tokens which allow the site to work as expected.</p>',
    fullText:'<p>Some cookies on this site are essential, and the site won\'t work as expected without them. These cookies are set when you submit a form, login or interact with the site by doing something that goes beyond clicking on simple links.</p><p>We also use some non-essential cookies to anonymously track visitors or enhance your experience of the site. If you\'re not happy with this, we won\'t set these cookies but some features of the site may be unavailable.</p><p>By using our site you accept the terms of our <a href="http://www.soyofthenorth.co.uk/privacy-policy">Privacy Policy</a>.</p>',
    position:'left', // left or right
    shape:'triangle', // triangle or diamond
    theme:'dark', // light or dark
    startOpen:true,
    autoHide:10000,
    subdomains:true,
    onAccept:function(){ccAddAnalytics()},
    onReady:function(){},
    onCookiesAllowed:function(){ccAddAnalytics()},
    onCookiesNotAllowed:function(){},
    countries:'' // Or supply a list ['United Kingdom', 'Greece']
    });

    function ccAddAnalytics() {
    $.getScript("http://www.google-analytics.com/ga.js", function() {
    var GATracker = _gat._createTracker('UA-xxxxxxxx-1');
    GATracker._trackPageview();
    });
    }
    //]]>
    </script>
    Can anyone shed some light on how to make some code like this work or where it should be placed?

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Where to add code?

    http://www.zen-cart.com/wiki/index.p...s_-_Javascript

    Save the file with a name beginning with jscript_, in the /includes/templates/your_template/jscript/ folder.
    Last edited by gjh42; 20 Apr 2012 at 04:48 AM.

  3. #3
    Join Date
    Mar 2011
    Posts
    19
    Plugin Contributions
    0

    Default Re: Where to add code?

    That worked. Thanks

    But it's stopped an easySlider slideshow on my front page from working. I'm guessing 2 scripts not getting on well together.

  4. #4
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Where to add code?

    If you do this all of your Google Analytics data will become completely pointless and unusable.

    http://zaddleinternetmarketing.com/w...to-Sharing.png

  5. #5
    Join Date
    Mar 2011
    Posts
    19
    Plugin Contributions
    0

    Default Re: Where to add code?

    If I don't do this legal action can be taken against me. If you want to risk going to court, go ahead.

    Anyone have any suggestions on why the new script stops the easySlider script from working?

  6. #6
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Where to add code?

    Quote Originally Posted by soyofthenorth View Post
    If I don't do this legal action can be taken against me. If you want to risk going to court, go ahead.

    Anyone have any suggestions on why the new script stops the easySlider script from working?
    'You' are not creating this cookie, Google is, so that is their issue, which Im sure they have covered. But if you allow people to prevent these on your site, you basically kill all your analytics, and if you're running PPC any conversion data.

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Where to add code?

    Quote Originally Posted by soyofthenorth View Post
    If I don't do this legal action can be taken against me. If you want to risk going to court, go ahead.
    Well... don't panic. It is more than likely that eCommerce sites will be considered EXEMPT from the "consent" provision.

    This means that:

    1. While you are obliged to inform your visitors that a session "cookie" is being used (and WHY),
    2. You do not explicitly need their consent for them to use the website. (They don't need to actively "click" a consent button for the site to operate.)

    FROM THE ICO DIRECTIVE:-

    13 December 2011
    Exceptions from the requirement to provide information and obtain consent.

    There is an exception to the requirement to provide information about cookies and obtain consent where the use of the cookie is:

    (a) for the sole purpose of carrying out the transmission of a communication over an electronic communications network; or
    (b) where such storage or access is strictly necessary for the provision of an information society service requested by the subscriber or user.

    In defining an 'information society service' the Electronic Commerce (EC Directive) Regulations 2002 refer to 'any service normally provided for remuneration, at a distance, by means of electronic equipment for the processing (including digital compression) and storage of data, and at the individual request of a recipient of a service'.

    The term 'strictly necessary' means that such storage of or access to information should be essential, rather than reasonably necessary, for this exemption to apply. However, it will also be restricted to what is essential to provide the service requested by the user, rather than what might be essential for any other uses the service provider might wish to make of that data. It will also include what is required to comply with any other legislation the person using the cookie might be subject to, for example, the security requirements of the seventh data protection principle.
    Where the setting of a cookie is deemed 'important' rather than 'strictly necessary', those collecting the information are still obliged to provide information about the device to the potential service recipient and obtain consent.

    This exception is likely to apply, for example, to a cookie used to ensure that when a user of a site has chosen the goods they wish to buy and clicks the ‘add to basket’ or ‘proceed to checkout’ button, the site ‘remembers’ what they chose on a previous page. This cookie is strictly necessary to provide the service the user requests (taking the purchase they want to make to the checkout) and so the exception would apply and no consent would be required.

    The Information Commissioner is aware that there has been discussion in Europe about the scope of this exception. The argument has been made in some areas that cookies that are used for resource planning, capacity planning and the operation of the website, for example, could come within the scope of the exemption. The difficulty with this argument is that it could equally be made for advertising and marketing cookies (whose activities help to fund websites). The intention of the legislation was clearly that this exemption is a narrow one and the Commissioner intends to continue to take the approach he has outlined clearly in published guidance since the 2003 Regulations were introduced.
    19 years a Zencart User

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Where to add code?

    HOWEVER...

    Things get a little more "complicated" if/when you use Google Analytics (or similar tracking system), because these RECORD the user's behaviour.

    In such cases, I would imagine specific consent must be given...
    19 years a Zencart User

  9. #9
    Join Date
    Nov 2009
    Location
    UK
    Posts
    1,090
    Plugin Contributions
    0

    Default Re: Where to add code?

    If this comes in effect and you want it as neat and inobtrusive on your website, Id put the tick box/info into a Zencart sidebox.

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Where to add code?

    The directive requires that the site only starts to operate AFTER the user has given consent. It is a big issue and is of concern to every site operator. Perhaps someone could build a module that initiates the desired behaviour...
    19 years a Zencart User

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Where do I add Winbuy code???
    By raildawg in forum General Questions
    Replies: 5
    Last Post: 15 Aug 2011, 04:05 AM
  2. where to add this code?
    By lina0962 in forum Basic Configuration
    Replies: 8
    Last Post: 30 Sep 2010, 02:28 AM
  3. where to add image code?
    By ssbeats in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Jan 2008, 11:15 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR