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

  • Log in to the Magento administrator area and go to System > Magento Connect > Magento Connect Manager
  • Re-enter your Magento Administration Credentials
  • Select the Create Backup checkbox and select the backup type.

Once you’ve created a backup, you can upload the package available here. Or:

  • Get the iubenda Cookie Solution extension from the Magento Marketplace clicking on Add to cart and completing the order with the Install button.
  • Copy the Access Key for the purchased extension, go back to System > Magento Connect > Magento Connect Manager and paste the key in the Paste extension key to install: field.
  • Click the Install button and then Proceed to perform the installation.

Once the extension is installed go back to Magento admin and configure your iubenda extension.

  • Get the iubenda Cookie Solution extension from the Magento Marketplace clicking on Add to cart and completing the order with the Install button.
  • Log in to the Admin of your Magento store as a user with full administrator rights.
  • On the Admin sidebar, click System > Web Setup Wizard (under “Tools”).
  • Select Extension Manager. Paste the Public Access Key and Private Access Key from your Marketplace account. Then, click Submit.
  • To synchronize Component Manager with your Marketplace purchases, click Sync (it might take a few minutes).
  • In the Marketplace Purchases section (under “New Purchases”), click Install.
  • In the Extensions Grid, mark the checkbox of the extension you want to install (in this case, iubenda Cookie Solution). Then in the relevant Action column, click Install.

You’re almost done. Follow these steps to complete the installation:

  • Readiness check: before the installation begins, your store environment must be checked for compatibility: click on Start Readiness Check when you’re ready to begin, then Next when the readiness check completes successfully.
  • Create backup: your store will be put in maintenance mode while the backup is created. When you’re ready to begin, click Create Backup. Click Next when the backup is complete.
  • Component install: your store will be taken offline to protect shoppers during the installation. When you are ready to begin, click Install. When complete, click Back to Setup Tool. Then, click on the Component Manager tile. In the upper-right corner of Component Manager, click the Reset link to log out.
  • Flush caches: on the Admin sidebar, select System > Cache Management (under “Tools”). Mark the checkbox at the beginning of the “iubenda Cookie Solution” row. Set Action to Refresh, and click on Submit.

For more info check the Magento User Guide.

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 be blocked by entering the source into the Custom Script boxes in the plugin console or by using the manual wrapping method illustrated in the example below and (in more detail) in this help post

Blocking custom scripts from within the console

The Custom Scripts field makes it easy for you to block scripts inserted into the page directly from within the plugin console. This greatly reduces the need for direct edits to the site’s code.

In the admin panel go to System > Configuration. Next, click on iubenda Cookie Solution in the left in the Configuration menu under Services. iubenda cookie solution custom scripts interface

Next, simply scroll to the section titled Custom iubenda cookie solution custom scripts interface

Enter your script or iframe sources as needed, and click the Save Config button at the top of the page.

In the admin panel, go to Stores > Configuration > iubenda > iubenda Cookie Solution.magento iubenda config menu

Scroll to find the Custom scripts and Custom iframes fields within the section titled Custom.iubenda cookie solution custom scripts fields

Enter your script or iframe sources as needed, and click the Save Config button at the top of the page.

Usage Examples

Using these fields are pretty straightforward. Simply enter the script or iframe src attribute you’d like to block.

Script

If you wanted to block a social button (which inserts scripts into the page via JavaScript), you’d simply need to enter the script source, e.g. connect.socialwebsite.net/en_US/track.js into the scripts field.

iframe

Let’s say you wanted to block scripts inserted into the page via the following iframe

<iframe width="1280" height="720" src="https://www.videowebsite.com/embed/xxFhMChxx" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> 

What you’ll need to enter into the iframe field would be videowebsite.com/embed/ as this is the actual source of the scripts. Be careful NOT to enter the component id (videowebsite.com/embed/xxFhMChxx) to ensure that all scripts coming from the actual source are blocked.

Manual Use (wrapping method)

This method requires you to directly modify your site’s code. You’ll need to go into the relevant section of your site’s code and add the scripts to be blocked as explained below.

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

<!--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.socialwebsite.net/en_US/sdk.js#xfbml=1&version=v2.3&appId=808061959224601";
        fjs.parentNode.insertBefore(js, fjs);
    }(document, 'script', 'socialwebsite-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-->

Install the Cookie Solution extension

Magento 1.9.x

Read the changelog

or

Magento 2.x

Read the changelog

See also

Still have questions?

Visit our support forum Email us