Documentation

Cookie Solution – Magento Module Installation Guide

  • Modules are available for both Magento 1.9.x and 2.x
  • Modules work better with versions of PHP 5.5 or later

Functionality

  • Modules automatically add the iubenda code to all the pages of a site (to the HEAD section)
  • They manage the visualization of the banner and of the cookie policy, as well as the saving of user’s consent preferences as per cookie installation
  • They simplify the management of the iubenda Cookie Solution for multilingual sites
  • AdRoll
  • AddThis widgets
  • Bing
  • CodePen
  • Criteo
  • Disqus
  • Elevio
  • Facebook Comments
  • Facebook widgets
  • Freshchat
  • Google AdSense
  • Google Analytics
  • Google Maps
  • Google ReCaptcha
  • Google Site Search
  • Google Tag Manager
  • Google oAuth
  • Google+ widgets
  • Headway
  • Instagram widgets
  • Kissmetrics
  • LinkedIn widgets
  • Mixpanel
  • Neodata
  • Olark
  • Optimizely
  • Outbrain
  • PayPal widgets
  • Pingdom
  • Pinterest widgets
  • Segment
  • ShareThis widgets
  • Twitter widgets
  • UserVoice
  • Vimeo
  • YouTube

Installation

Firstly, copy the contents of the zipped extension folder to the required Magento directory: /magento/app/

The iubenda Cookie Solution module can be installed via any ONE of these two methods:

Method 1: Admin installation

In the admin panel go to System -> Configuration -> Advanced -> Advanced.

iubenda Cookie Solution for Magento 1.9.x

Now in “Disable Modules Output” box find Iubenda_Cookiesolution and enable it (if you have problems finding the Iubenda_Cookiesolution clear cache in System -> Cache Management and try again).

iubenda Cookie Solution for Magento 1.9.x
Method 2: Shell installation

This method requires access to the server shell.

You simply need to type in "php bin/magento setup:upgrade". This command should do the trick. It checks all of the modules and launches schema installation or update process.

Firstly, copy the contents of the zipped extension folder to the required Magento directory: /magento/app/code/.

The iubenda Cookie Solution module can be installed via any ONE of these three methods:

Method 1: Wizard installation

In the admin panel go to System -> Web Setup Wizard -> Module Manager.

Magento web setup wizard

Locate the iubenda_cookiesolution and enable it.

Enable iubenda CS magento module

Magento will now check your environment for the correct PHP version, PHP extensions, file permissions, cron and compatibility. You need to pass all checks in order to proceed.

Module install readiness check magento

After that Magento will ask about backup and after those preferences are set, you will be able to enable the iubenda module.


Method 2: Manual installation

Via an ftp client or your cpanel, go to /magento/app/etc folder and open config.php file. At the end of the file, add a single line of code: ‘iubenda_cookiesolution’ => 1 (exactly as written, right after the last extension code). Save the file.

Config.php file for manual Magento installation

Now go to admin panel and refresh the cache (you can do it in System > Cache Management). Select everything on the list, use refresh action and click Submit.

Cache management magento
Method 3: Shell installation

This method requires access to the server shell.

You simply need to type in “php bin/magento setup:upgrade“. This command should do the trick. It checks all of the modules and launches schema installation or the updating process.

Configuration

After the installation is successfully completed, go to “Stores > Configuration > iubenda > iubenda Cookie Solution” (this is the place where you can configure our module).

Copy & paste your Cookie Solution JavaScript code from your iubenda account (as explained on the introduction guide), save and flush the cache storage.

Caution
  • Don’t forget to save valid JavaScript code there to make sure the module works properly.

Use

Once configured, the plugin will begin to show the banner on which your cookie policy will be shown/linked to users that visit your site for the first time without the need for any other further configurations. The plugin will also recognize and automatically detect and block the cookies indicated in the above block-list, that are present on your site.

Important

Our Magento extensions automatically block scripts that are generated on the server side (therefore returned by PHP by Magento). Scripts that are inserted into the page via JavaScript after the loading process of that page are not and cannot be blocked automatically.

These scripts can still be blocked prior to consent by using the wrapping method illustrated in the example below and (in more detail) in this help post

Manual Use

Here’s an example of how to make the plugin manually work for a Facebook button (which inserts scripts into the page via JavaScript as mentioned above).

<!--IUB-COOKIE-BLOCK-START-->
<script>
    (function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s);
        js.id = id;
        js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=808061959224601";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'facebook-jssdk'));
</script>
<!--IUB-COOKIE-BLOCK-END-->

If there are HTML / IMG / IFRAME elements, you will need to do it this way:

<!--IUB-COOKIE-BLOCK-START-->
      <iframe src="...
      <img src="...
<!--IUB-COOKIE-BLOCK-END-->
1.0.4

New: Option to block custom scripts and iframes
Tweak: Update and extend the list of blocked scripts including Google Site Search, Google oAuth, Linkedin widgets, PayPal widgets, Freshchat, UserVoice, AdRoll, Olark, Segment, Kissmetrics, Mixpanel, Pingdom, Bing and Elevio

1.0.2

Tweak: Update and unify iubenda parsing engine

1.0.1

Tweak: iubenda faster class regex update

1.0

Initial release

See also

Still have questions?

Visit our support forum Email us